Bulk emailing from Access Database

C

Chris Roberts

Is it possible to send something like a newsletter to all my Customers using the email address stored in an Access 2000 database stored as text via Microsoft Outlook 2000 or Outlook Express. If so, how, and is it best done via Access or the mailing program

Chris Robert
http://wwwcosta-holiday-pad.co.u
 
C

Cheryl Fischer

You definitely can send emails to your customers using email addresses
stored in an Access database. There are a couple of ways to do this:

1. Use SendObject. While this method is often used to send a copy of a
report or query, it can be used to send a message only. If fact, its
default is to "send no object". You can create your message in a text box
on a form and then loop through each record in your customers table to
insert an email address.

2. Use Outlook Automation. Automation exposes more of the options
available in Outlook to your program to send emails such as formatting your
message using HTML, adding multiple attachments, etc. Automation works only
with Outlook - not Outlook Express.

If there is a downside to using Access to send emails, it is probably the
Outlook Security Prompt, a message that pops up each time your program
attempts to send an email, saying something like: "A program is trying to
automatically send e-mail on your behalf. Do you want to allow this? If
this is unexpected, it may be a virus and you should choose "No"." You
have to wait a couple of seconds for the 'Yes' button to become enabled.
The Outlook Security Prompt cannot be turned off, although settings can be
adjusted in an Exchange environment to bypass it. Work-arounds to the
Outlook Security Prompt include a downloadable free utility to click the
'Yes' button and purchasable third-party libraries.

If you also have your email addresses stored in Outlook, you can create
distribution lists. For example, your Outlook email addresses could include
personal, family and customer emails. You could create a Customers
Distribution List containing only addresses for customers. You could then
create a single email to the Customers Distribution List and all email
addresses in that list will receive the email.

hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


Chris Roberts said:
Is it possible to send something like a newsletter to all my Customers
using the email address stored in an Access 2000 database stored as text via
Microsoft Outlook 2000 or Outlook Express. If so, how, and is it best done
via Access or the mailing program.
 
C

Chris Roberts

Thanks for that Cheryl, I have it working using sendobject and looping through the records, the only problem I have with that is, it stops after creating each email and waits for me to click on the send button before moving on, not very good if I have 1000+ customers, is there a way I can make it automated and quicker. This the code i am using, it checks that all the required fields have content first then goes into the loop

Dim counta, countb As Intege

If IsNull(Me![2bmsalesrep]) The
MsgBox "You must select a Sales Rep before proceeding
Me![2bmsalesrep].SetFocu
Els
If IsNull(Me!Subject) The
MsgBox "You must enter the subject before proceeding
Me![Subject].SetFocu
Els
If IsNull(Me!Message) The
MsgBox "You must type a message before proceeding
Me![Message].SetFocu
Els
Forms![bulk email messages].RecordSource = "email list query
counta = DCount("emailaddress", "email list query"
countb =
D
DoCmd.SendObject , , , [EmailAddress], , , [Subject], [Message
countb = countb +
If countb = counta The
Exit D
End I
DoCmd.GoToRecord , , acNex
Loo
End I
End I
End I

Thanks in advanc

Chris Robert
http://www.costa-holiday-pad.co.u
 
C

Cheryl Fischer

Chris,

Add one additional argument to your code:

DoCmd.SendObject , , , [EmailAddress], , , [Subject], [Message],
False

I added False (the EditMessage argument), so that the message will be sent
without opening the message for editing.


hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX


Chris Roberts said:
Thanks for that Cheryl, I have it working using sendobject and looping
through the records, the only problem I have with that is, it stops after
creating each email and waits for me to click on the send button before
moving on, not very good if I have 1000+ customers, is there a way I can
make it automated and quicker. This the code i am using, it checks that all
the required fields have content first then goes into the loop:
Dim counta, countb As Integer

If IsNull(Me![2bmsalesrep]) Then
MsgBox "You must select a Sales Rep before proceeding"
Me![2bmsalesrep].SetFocus
Else
If IsNull(Me!Subject) Then
MsgBox "You must enter the subject before proceeding"
Me![Subject].SetFocus
Else
If IsNull(Me!Message) Then
MsgBox "You must type a message before proceeding"
Me![Message].SetFocus
Else
Forms![bulk email messages].RecordSource = "email list query"
counta = DCount("emailaddress", "email list query")
countb = 0
Do
DoCmd.SendObject , , , [EmailAddress], , , [Subject], [Message]
countb = countb + 1
If countb = counta Then
Exit Do
End If
DoCmd.GoToRecord , , acNext
Loop
End If
End If
End If

Thanks in advance

Chris Roberts
http://www.costa-holiday-pad.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top