Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Exchange 2013 free and busy between mailbox databases 77 183
AWS RDS Backups? 3 61
best datatype for oracle table email creation 8 73
SQLite with Mobile Development 4 45
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Read about achieving the basic levels of HRIS security in the workplace.
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…

685 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