Sending email to multiple addresses from Access

  • Thread starter Thread starter Agnes Banks
  • Start date Start date
A

Agnes Banks

Hi!
I am already sending emails from individual records in Access 2002, but I
would like to be able to send one email to multiple addresses from a
query/report.
Any suggestions how to handle it?
Thanks
 
Hello Agnes,

Here is code that I have used to create a single email to multiple
recipients.

Dim oApp As Outlook.Application
Dim objNewMail As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim rs As DAO.Recordset

' Uses the record source of a form with multiple records
Set rs = Me.RecordsetClone

Set oApp = New Outlook.Application

Set objNewMail = oApp.CreateItem(olMailItem)
With objNewMail
'Loop through recordset to add recipients
rs.MoveFirst
Do While Not rs.EOF
If Len(Trim(rs!Email)) > 0 Then
Set objOutlookRecip = .Recipients.Add(rs!Email)
objOutlookRecip.Type = olTo
End If
rs.MoveNext
Loop
.Subject = "Test subject"
.Body = "Your text message here."
.Save
.Send
End With

hth,
 
Back
Top