在Outlook邮件中包含多个CC

问题描述 投票:0回答:2

我有一个程序,当用户添加时,会向用户发送和发送电子邮件。

我想要将电子邮件发送到IT团队的多个成员中,但是,我只能将CC发送给一个人。

以下是我的代码:

                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

这导致电子邮件根本不发送。我也尝试了下面这个,只有CC是最后一个人而不是两个人。

                ' 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

有一种简单的方法可以解决这个问题吗?

vb.net email outlook carbon-copy
2个回答
2
投票

与标准电子邮件客户端不同,Outlook使用;而不是,将TO,CC和BCC行中的条目分开。将您的CC行更改为

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

它应该发送给两者。


2
投票

你的第一次尝试不是那么糟糕。只需用分号替换逗号即可。我认为它应该像这样工作

    .CC = "[email protected]; [email protected]"
© www.soinside.com 2019 - 2024. All rights reserved.