Sending 2 recipient lists in an email using VBA Code

Nikki2306

New Member
Joined
May 22, 2014
Messages
40
Hi

I am trying to put in 2 .To array lists however it's not letting me do it or I keep getting it wrong. How can I send to 2 lists of recipients?

On Error Resume Next
With OutlookMessage
'.SendUsingAccount = oAccount
.SentOnBehalfOfName = "data.controller@gwr.com"
.To = recipientsArray
.To = recipients1
.CC = "data.controller@gwr.com"
'.BCC =
.Subject = Subject
.HTMLBody = BodyText
.Attachments.Add Attachments
.Display
'.Send
End With
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
.
Untested :


Try this ...

Code:
[COLOR=#333333]On Error Resume Next[/COLOR]
[COLOR=#333333]With OutlookMessage[/COLOR]
[COLOR=#333333]'.SendUsingAccount = oAccount[/COLOR]
[COLOR=#333333].SentOnBehalfOfName = "data.controller@gwr.com"[/COLOR]
[COLOR=#ff0000][B].To = recipientsArray, recipients1[/B][/COLOR]
[COLOR=#333333].CC = "data.controller@gwr.com"[/COLOR]
[COLOR=#333333]'.BCC =[/COLOR]
[COLOR=#333333].Subject = Subject[/COLOR]
[COLOR=#333333].HTMLBody = BodyText[/COLOR]
[COLOR=#333333].Attachments.Add Attachments[/COLOR]
[COLOR=#333333].Display[/COLOR]
[COLOR=#333333]'.Send[/COLOR]
[COLOR=#333333]End With[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,173
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top