Emailing from Access (1 Viewer)

Simes2112

New member
Local time
Today, 14:42
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:42
Joined
Oct 29, 2018
Messages
21,473
Hi. One way is to specify the field in your email. For example:
Code:
.To = ToEmailAddressHere
.Cc = CcEmailAddressHere
Hope that helps...
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 14:42
Joined
Sep 12, 2006
Messages
15,657
Can't you do recipients.add multiple times. Or make email address a string of email addresses. It must be something like that.
 

Simes2112

New member
Local time
Today, 14:42
Joined
Aug 15, 2022
Messages
4
Hi. One way is to specify the field in your email. For example:
Code:
.To = ToEmailAddressHere
.Cc = CcEmailAddressHere
Hope that helps...

Tried that, but it didn't work. Do you have an example of how this would work?
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:42
Joined
Sep 21, 2011
Messages
14,306
You need to specify the type when you use .Add else I think it defaults to .To ?
 

Users who are viewing this thread

Top Bottom