Solved

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

Posted on 2006-07-14
1
239 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
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
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…

863 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

22 Experts available now in Live!

Get 1:1 Help Now