Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sending email to email adresss specifieed on the form (dinamically selected)

Posted on 2006-07-14
1
Medium Priority
?
247 Views
Last Modified: 2008-03-04
Hi,

I have on equestion that may be better split into two parts:

What I wanted to achieve is to select mentor and bdm from a dropdown boxes on a frm_client form ( i display name but store id in the table) and (if I need to get a hidden field populated with mentors email address from the mentors table, and bdm from tbl_bdm) for the use for emailing. Hopefully this should happen on loss of focus from the drop down boxes. Related to that is the second part of my question..

I would like to send an email with the relevant information to both mentors and bdm’s email address for that client. Information is coming from the tbl_client_leads. I have created a macro that will pick some details from my query and display it in a report that will be attached, but what i am having trouble is to use the email addresses specified in a part one of this question on the fly. Reason being becouse some of my clients might have different mentors and different BDM's.  Also in the email that is going out I would like to attach a predefined file which is a brochure in PDF format.


Thank you in advance.
0
Comment
Question by:VilkoP
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 65

Accepted Solution

by:
rockiroads earned 2000 total points
ID: 17114001
What database?

If access, then try this suggestion

u can make use of DoCmd.SendObject

what kind of email do u want to send, is it just text?

e.g.

your dropdown box, I assume your rowsource is something like this
select mentorid, name, emailaddress from mentors table

So in order to reference a particular column, in this case the third column, u do (if dropdown was called cboMentor)

cboMentor.Column(2)   'column 0 means 1st column, column 1 means 2nd columnn etc

THis wiill give u the email

Now to send an email, u can one of three choices

1. DoCmd.SendObject
2. Outlook Automation
3. CDO

Rather than me explain here, I will give u a link whereby I have already done this explanation

http://www.experts-exchange.com/Databases/MS_Access/Q_21866975.html


Now with later versions of Access, it has security so using SendObject or Outlook, u can a security message
Using CDO, u dont as it talks direct to exchange but u do need to know the smtp server
Now workarounds for Outlook and SendObject is described here  http://www.experts-exchange.com/Databases/MS_Access/Q_21904604.html


Now in your code, what u need to do is select one mentor and one bdm, then u can send that one email
If u want multiple selections, u need to change to a listbox

Attaching files is no problem but u cant really do that with SendObject

If its not Access, let us know what DB you are using.

I will be briefly looking at EE today so apologies if I dont get back in time to answer your questions. Im sure other people will be on hand to help you
But if its Access, hopefully the informatin I gave u will help u

I gave u links to answers as those are my accepted solutions and it saves having to duplicate that
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question