By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,689 Members | 1,787 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,689 IT Pros & Developers. It's quick & easy.

Emailing with Access

P: n/a
I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.
Jun 27 '08 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On Apr 29, 1:30*pm, marjb...@gmail.com wrote:
I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.
You may want to consider using MS Word. Create the document as you
would any mail merge using a query of your Access data as the data
source. Select "Merge to Email" as your output option.

I like this approach because it allows personalization of the outgoing
message ("Dear Tim, you've been a member of XYZ for 12 years") and
it's easy to assign the task to any staff person (all they really need
to know if Word).

Note that your ISP may not like the volume of messages going out
through Outlook/Exchange and it can take a while to cycle through
several thousand records. Then you'll have to sort through the
undeliverable/returned mail, but that can be quite an education about
your customers.

For a large volume solution you may want to look at a commercial email
service such as Constant Contact or similar.

Good luck,

Tim Mills-Groninger
Jun 27 '08 #2

P: n/a
On Tue, 29 Apr 2008 11:30:04 -0700 (PDT), ma******@gmail.com wrote:
I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.
Download
EmailSenate or EmailSenate2K
from
http://www.datastrat.com/DataStrat2.html
for a working sample database.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jun 27 '08 #3

P: n/a
ma******@gmail.com wrote:
>I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.
Poke about at the Microsoft Access Email FAQ
http://www.granite.ab.ca/access/email.htm

You will need to use VBA code to run through a recordset to individually send the
emails. For sample recordset logic see
http://www.granite.ab.ca/access/email/recordsetloop.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
Jun 27 '08 #4

P: n/a
It used to be you could send out emails through outlook from Access, but
now Outlook has all these security prompts each time you interface with
Outlook - which makes it pretty much unsuable from/through automation.

The easiest solution I came up with was to write my own Emailer program
in VB.Net which contains all the classes required for emailing using
whatever mail server Outlook would use. I can read the email addresses
from an Access mdb and then send them out through my emailer program --
adding a generic subject line/body.

I realize this is not a .Net forum, but incase anyone cares, here is the
part of the .Net code which would send out the emails:

-------------------------------------------
Imports System
Imports System.Data
Imports System.Net.Mail
Imports System.IO

Private Sub SendTheEmail()
Try
Dim Client As SmtpClient
Dim Message As MailMessage
Dim strRegex As String
strRegex =
"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-
Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"
Dim Expression As New System.Text.RegularExpressions.Regex(strRegex)

Message = New MailMessage
Message.From = New MailAddress(txtFrom.Text)

For Each dr As DataRow In tblEmail.Rows
'--validate email before adding to Send Email list
If Not Expression.IsMatch(dr("Email").ToString) Then
Throw New System.Exception("Invalid Email Address Exception has
occured for " & dr("ID_Main").ToString & " " & dr("Email").ToString)
Else
Message.To.Add(New MailAddress(dr("Email").ToString))
End If
Next

Message.Subject = txtSubject.Text
Message.Body = rtbBody.Text

Message.IsBodyHtml = True '-- use this if formatting with
'--html tags else exclude this line

'--my Outlook was using the comcast email server
Client = New SmtpClient("mail.comcast.com")

Client.Send(Message)
MessageBox.Show("done sending mail!")

Catch ex As Exception
MessageBox.Show(ex.ToString, "Problem with Email",
MessageBoxButtons.OK)
End Try
End Sub
----------------------------------------------

tblEmail is a .Net dataTable contained in the Emailer program which
contains the email addresses to mail to imported from an Access mdb.

This .Net program could also be created as a DLL which could be
referenced from an Access mdb, and actually, I could have eliminated the
.Net loop and just looped in Access -- calling the .Net dll for each
iteration of the loop. But instead I just read the whole table into the
.Net program and just emailed everything in one shot. The .Net program
also performs email validation using a Regular Expression - which this
could also be done directly in Access by Referencing RegEx in
Tools/References.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Jun 27 '08 #5

P: n/a
On Apr 29, 11:46*am, fredg <fgutk...@example.invalidwrote:
On Tue, 29 Apr 2008 11:30:04 -0700 (PDT), marjb...@gmail.com wrote:
I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.

Download
EmailSenate or EmailSenate2K
fromhttp://www.datastrat.com/DataStrat2.html
for a working sample database.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
That is very cool! Unfortunately, I don't know VBA well enough to
change it to suit it to an individual database. Thank you for your
help. I checked out the click event, and saw what I think might have
to be changed. But I am not sure how to do it. For all I know there
might be more to change than what I think too. Any suggestions?
Jun 27 '08 #6

P: n/a
On Apr 29, 11:42*am, timmg <tmillsgronin...@gmail.comwrote:
On Apr 29, 1:30*pm, marjb...@gmail.com wrote:
I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.

You may want to consider using MS Word. *Create the document as you
would any mail merge using a query of your Access data as the data
source. *Select "Merge to Email" as your output option.

I like this approach because it allows personalization of the outgoing
message ("Dear Tim, you've been a member of XYZ for 12 years") and
it's easy to assign the task to any staff person (all they really need
to know if Word).

Note that your ISP may not like the volume of messages going out
through Outlook/Exchange and it can take a while to cycle through
several thousand records. *Then you'll have to sort through the
undeliverable/returned mail, but that can be quite an education about
your customers.

For a large volume solution you may want to look at a commercial email
service such as Constant Contact or similar.

Good luck,

Tim Mills-Groninger
Thank you for your suggestion. Yes, I believe that would work whether
it was in Word or Excel. But as you say it would be a lot of training
for my customer.
Jun 27 '08 #7

P: n/a
On Tue, 29 Apr 2008 11:30:04 -0700 (PDT), ma******@gmail.com wrote:
>I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.
Create a query that has, as one of its fields, a variable which I will
call "OutlookEMail". The source of this query is a list of names,
from either a table or another query, that includes a field that has
the regular email address, such as po**@vatican.gov. The new field you
will create has, as its header in your query setup, looking like this:

OutlookEmail: '"' & [FirstLine] & '" <' & [EmailAddress] & ">"
The thing that looks like three apostrophes is:
single quote, double quote, single quote. (the single quotes are used
to bracket the double quote so that the double quote will not be
interpreted as a special character.) FirstLine is the name of the
person, such as "Benedict". The expression following the second
ampersand is single quote, double quote, space, <, single quote. This
will produce a line looking like:
"Bendict" <po**@vatican.gov>
You will then have a column in your output consisting of the first
line being "OutlookEmail", and then underneath it,
"Benedict"*<po**@vatican.gov>, "dubya"*pr*******@whitehouse.gov, and
so on. Select this column and put the column on your clipboard.
THEN: Get into Outlook and paste the clipboard into either the "To"
field or the BCC (blind carbon copy) field. Manually remove the top
entry, ie, delete "OutlookEmail" (this isn't a legitimate email
address).
You can simplify this if you don't want the aliases in your
Outlook list. If the query simply has the email addresses, you could
have the query simply list the email addresses (without the "pope"
etc). Again, copy the column onto the clipboard and paste it into
Outlook.
The main point here is that the clipboard is your useful tool
for doing this. You don't need to delve into the bowers of Access and
Outlook to link your two programs.
Pete Brady
Jun 27 '08 #8

P: n/a
ma******@gmail.com wrote:
I have a Access database of email addresses that I would like to mass
email to customers. Can Access be used through Outlook? or can it just
be done with Access? I know it is possible to use MailMerge for
snailMail.
I had a problem running VB and creating reports, so what I did was to
create a form with the information I wanted on it. I would display all
but the e-mail address. I would have one button that would allow me to
fire off the e-mails. The code would do:

- set the button to invisible.
- go to the first record in the set (use a DoCmd for this)
- use another DoCmd to send the e-mail to the person in the email
address. Send as a Snapshot.
- Use another docmd to go to the next record
- check to see if the e-mail adress is NULL (if so, stop the program)
then go to the first line again.

That would limit your coding.

The other option is to make a report that selects only one record from
the query. You could have a form that fires the code

' get the current record
' run a docmd to run the report,with the option to SendTo and where clause
' move to the next record (again with a do cmd)
' wash, rinse, repeat...

If you don't want to dirty your hands with code, then I think you are
out of luck. You could drop down a level and use macros, but code is
cleaner, and you can debug it while running.

Be sure to be liberal with the DoEvents otherwise you will hang your
system and flood some unsuspecting schmuck with a bunch of e-mail.
Open a few accounts on mail.google.com and mail to them to see how it
comes out.
Jun 27 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.