Emailing from Access

Simes2112

New member
Local time
Today, 21:23
Joined
Aug 15, 2022
Messages
4
I have a database where purchase orders are entered, PDFs are created and then emailed as attachments directly to the supplier. The code here works just fine ... BUT ...

Code:
'Email the results of the report generated
Set oApp = CreateObject("Outlook.Application")
Set oEmail = oApp.CreateItem(olMailItem)
With oEmail
    .Recipients.Add EmailAddress
    .Subject = "Purchase order from XYZ Company ref: " & SubjectPOnumber
    .Body = MessageText
    .Attachments.Add Filename
    .Send
End With

MsgBox "PO Email successfully sent!", vbInformation, "EMAIL STATUS"

... My question is this, I would like to be have more than one recipient which the additional ones being CC recipients and I can't work out how to do that. If I have to add them as TO recipients that is not the end of the world at all.

Any help / advice / guidance would be much appreciated.

Cheers,

Simes
 
Hi. One way is to specify the field in your email. For example:
Code:
.To = ToEmailAddressHere
.Cc = CcEmailAddressHere
Hope that helps...
 
Can't you do recipients.add multiple times. Or make email address a string of email addresses. It must be something like that.
 
You need to specify the type when you use .Add else I think it defaults to .To ?
 

Users who are viewing this thread

Back
Top Bottom