Search code examples
vb.netemailoutlookcarbon-copy

Including multiple CC's in an Outlook Mail


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 = "[email protected]"
                    .CC = "[email protected], [email protected]"
                    .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 = "[email protected]"
                    .CC = "[email protected]"
                    .CC = "[email protected]"
                    .Body = "Hi"
                    .Send()
                End With

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


Solution

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

    .CC = "[email protected]; [email protected]"
    

    and it should send to both.