我可能会弄错,但是尽管MSDN说,MailAddressCollection.Add(字符串地址)可用于设置地址 es ,但它不希望收到字符串之类的那个"1@1 2@2" ;,抛出一条带有消息的例外:
I might be mistaken, but in spite of MSDN saying, that MailAddressCollection.Add(string addresses) can be used to set addresses, it doesn't want to recieve string like that "1@1 2@2", throwing an exception with the message:
"传递的字符串格式不正确的电子邮件地址",或类似的东西。
"The passed string is not in correct format of e-mail address", or something like that.
所以问题是 - 是否可以通过.Add(字符串地址)方法将多个电子邮件地址添加到MailAddressCollection中?
So the question is - is it somehow possible to add several e-mail addresses into MailAddressCollection via .Add(string addresses) method?
或者是msdn或bcl中的错误...
Or is it a bug whether in msdn or bcl...
推荐答案
如果您尝试添加多个地址只需调用一次MailAddressCollection.Add方法,我假设您必须使用分号(;)
If you try to add more than one address with a single call to the MailAddressCollection.Add method, I assume you will have to seperate the email adresses with a semicolon ( ; )
Sven
更多推荐
将电子邮件地址添加到System.Net.MailMessage.To集合(+)
发布评论