outlook mass emailing

skate

Registered User.
Local time
Today, 06:21
Joined
May 22, 2002
Messages
136
is there any way to create an email in outlook by using the addresses listed in my database?
 
To do via a command button: Use the wizard to Mail Report. Then go into your code and add after the SendObject acReport, stDocName bit:


... stDocName, "SnapshotFormat(*.snp)", [NameOfEmailField], , , "Name You Want in the Subject Header"

This will do one email per record - it's a bit different if you wanted a bulk email, and someone else may be able to help you on that. You'd probably need some code.

Lookup SendObject in the Access Help to get more info on the output formats (sending as text / html / rtf etc) - the above will send as a Snapshot Format. There's also lots of posts on this forum about SendObject.
 
Here's what I use to send a mass email using addresses in a table:
Code:
Private Sub Form_Load()
Dim rsDLS As Recordset 'shows date mail was last sent
Dim rsEmail As DAO.Recordset  'the recordset with the email addresses to be used
Dim strEmail As String  'the email address
Dim strMessage As String  'message to be sent
Dim strSubject As String  'subject of message
Dim strJobNum As String  'the job posting number
Dim strJobTitle As String  'the title the job is listed under
Dim PD As Date  'the date the job was originally posted
Dim DLS As Date  'date emails were sent last
Set rsDLS = CurrentDb.OpenRecordset("tblDateLastSent") 'table where DLS is stored
rsDLS.MoveFirst 'makes sure correct record is selected
DLS = rsDLS.Fields("DateLastSent").Value  'sets value of DLS
If DLS = Date Then
Set rsDLS = Nothing
DoCmd.close  'if mail has already been sent, sub exits and form closes
Exit Sub
Else
Set rsEmail = CurrentDb.OpenRecordset("tbl27Days")  'opens table with email addresses
On Error Resume Next  'skips email addresses with errors
Do While Not rsEmail.EOF  'loops through until the end of the table
strEmail = rsEmail.Fields("E-mail").Value  'sets email address value
strJobNum = rsEmail.Fields("JobNumber").Value  'sets job number value
PD = rsEmail.Fields("PostDate").Value  'sets post date value
strJobTitle = rsEmail.Fields("JobTitle").Value  'sets job title value
strMessage = "Your job on the ISU job board, job #" & strJobNum & " entitled: " & strJobTitle & ", which was posted " & PD & ", will be removed on " & DateAdd("d", 3, PD) & " unless you contact us before that date.  Thank you.  -OSFA staff" 'message to be sent
strSubject = "Job Number " & strJobNum & " on the ISU job board"  'subject of message to be sent
DoCmd.SendObject , , , strEmail, , , strSubject, strMessage, False  'sends emails using above parameters
rsEmail.MoveNext  'goes to next record
Loop  'starts whole process over again
Set rsEmail = Nothing 'closes table
End If
DoCmd.close  'closes form when completed
End Sub

EDIT: I commented my code
 
Last edited:
I use the DateLastSent value to only send the emails once a day, since the table changes each day.

If you have any questions on what the stuff means, let me know.
!eww@mail.adp.iastate.edu
 

Users who are viewing this thread

Back
Top Bottom