Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-07-14
1
Medium Priority
?
248 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 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

885 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