开发者

How can I add multiple email addresses in Outlook field "To" via C#?

Anybody know how can I add multiple email addresses in Outlook field "To" via C#?

foreach (var to in mailTo)
            newMail.To += to + "; ";

When I try do it 开发者_如何学Pythonhow I described this above I receive next kind of string: mail1@mail.commail2@mail.commail3@mail.com


The += operator doesn't work how you are trying to use it.

a += b + c;

has no meaning. If you want to do it this way you'll have to add brackets around the right hand side:

newMail.To += (to + "; ");


newMail.To.Add(new MailAddress(to));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜