[AccessD] Automated EMAIL in Access/Outlook

Darren D darren at activebilling.com.au
Sun Sep 28 18:47:54 CDT 2008


Hi Paul

There are a few ways these questions can be dealt with

Last question first: A field in a table that will be an email address is best
stored as text - Set the max length to be >100 or so - Some real and live email
address are stupidly long 

Also I am not sure if "Email" is a reserved word in Access or not, I am in the
habit of calling any fields that store email addresses "EmailAddress" just in
case it is a reserved word (Much the same way we don't name fields that store
dates "Date" in the table - Name 'em something like "StartDate" etc)

Now first question: Assume you have a control on a form and assume the control
is called called txtClientEmailAddress

In the double click of that you could have some think like

Private Sub txtClientEmailAddress_ DblClick(Cancel As Integer)
'Watch for line wrap
DoCmd.SendObject , , , Me.txtEmailAddress, Me.txtCCEmailAddress, , "Subject Goes
Here- This can be a text box on an access form", "Message goes here - this too
can be a field on an access form", True
'The inclusion of the word 'true' at the end of the send object parameters
insists the email is opened in your default email client (whatever that is)
before it gets sent to allow you to edit it

If you add the word false then the email gets sent 'silently but it does end up
in the out box eventually (Assuming it gets sent) so not 100 per cent silently
:-) 
End sub

The cool thing about the DoCmd.SenObject method above is you can send the
results of queries, reports tables etc as attachments with the email - but it is
a bit limited in other areas

You could also experiement with 'shelling to the MailTo: feature of the
operating system - That's pretty simple

And if you feel brave there is tons of code to directly 'interact' with Outlook
or outlook express


No to the 2ns question - It's probably best to set up a recordset and loop
through that - Lemme know if you need a hand with that

The big caveat with looping through a recordset to send emails is that you will
most likely be 'recognised' as a spammer of some sort (Correctly or not)

So thos on thelist with more nouse than me re mail servers etc can chime in

Let us know how it turns out
 
Darren

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of paul_lifopro
Sent: Saturday, 27 September 2008 5:39 AM
To: accessd at databaseadvisors.com
Subject: [AccessD] Automated EMAIL in Access/Outlook

I have an Access 2003 db that has a text field in it with email address in
the text field.  I've checked the archives and Google, but can't find the
answer to my questions.  I have 2 questions.

 

1.  Is there a way that I can click on the email field and have Outlook 2003
start up and let me create an email and send it?

 

2.	Monthly I send out a newsletter email.  Can I run an access query
and then have outlook send out an email to all of the email addresses that
are in the recordset.

 

3.  What type of Access data type field should I have the email address
stored in.

 

Thanks for your help

 

Paul

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list