i use this way to send emails using VBA
Dim objol As New Outlook.Application
Dim objMail As MailItem
Set objol = Outlook.Application
Set objMail = objol.CreateItem(olMailItem)
With objMail
.To = "whoever@whoever.com"
.Subject = "TReport Update for " & Format(ddate, "dd.mm") & " data."
.Body = "Hi," & vbCrLf _
& "The Data has been updated, please remember that there may be" & vbCrLf & vbCrLf _
& "changes as this has been automatically generated." & vbCrLf & vbCrLf _
& "Regards and Thanks" & vbCrLf & vbCrLf _
& "Rob." & vbCrLf & vbCrLf
.Attachments.Add pname
.Display
End With
Set objMail = Nothing
Set objol = Nothing
you have to set references to outlook in Access,
you can repeat this line as many times as you like.
.Attachments.Add pname
I just usually change pname to pname2 etc.
pname is a variable that is set earlier in the coding.
Hope this is of use, Rob.![[yoda] [yoda] [yoda]](/data/assets/smilies/yoda.gif)