1

I have a program that sends and email out to user when they have been added in.

I want the email to cc in multiple members of the IT team, however, I can only get it to CC to one person.

Below is my code:

                objMail = CType(objOutlook.CreateItem(Outlook.OlItemType.olMailItem), Outlook.MailItem)

                ' Set the properties of the email.
                With objMail
                    .Subject = "Website Credentials"
                    .To = "chris.downs@test.com"
                    .CC = "benji@test.com, Alicia@test.com"
                    .Body = "Hi"
                    .Send()
                End With

This causes the email not to send at all. I have also attempted the below and this only CC's the last person not both.

                ' Set the properties of the email.
                With objMail
                    .Subject = "Website Credentials"
                    .To = "chris.downs@test.com"
                    .CC = "benji@test.com"
                    .CC = "Alicia@test.com"
                    .Body = "Hi"
                    .Send()
                End With

Is there a simple way of doing this that I'm missing?

braX
  • 11,506
  • 5
  • 20
  • 33
benjiiiii
  • 478
  • 10
  • 33
  • Possible duplicate of [How to add multiple recipients to mailitem.cc field c#](https://stackoverflow.com/questions/16691888/how-to-add-multiple-recipients-to-mailitem-cc-field-c-sharp) – A Friend Mar 06 '18 at 12:22
  • @AFriend - Relevant, not necessarily duplicate. – Jeff Zeitlin Mar 06 '18 at 12:25

2 Answers2

3

Outlook, unlike standard email clients, separates entries on the TO, CC, and BCC lines with ;, not ,. Change your CC line to

.CC = "benji@test.com; Alicia@test.com"

and it should send to both.

Jeff Zeitlin
  • 9,773
  • 2
  • 21
  • 33
3

Your first try wasnt that bad. Just replace the comma with a semicolon. I think it should work like this

    .CC = "benji@test.com; Alicia@test.com"
Simon H.
  • 131
  • 9