Solved

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

Posted on 2006-07-14
1
238 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
1 Comment
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

762 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now