开发者

The specified string is not in the form required for an e-mail address

开发者 https://www.devze.com 2023-01-31 05:00 出处:网络
I search the eror But I found nothing. My Mail setting is well form. Is there any idea what couse of this exception?

I search the eror But I found nothing. My Mail setting is well form. Is there any idea what couse of this exception?

Mail Configuration

<add key="SMTPFrom" value="mailer@mycompany.com" />
<add key="SMTPReplyTo" value="mailer@mycompany.com"/>
<add key="SM开发者_如何学JAVATPCredentialUserName" value="company_mailer_system"/>
<add key="SMTPCredentialPassword" value="password"/>
<add key="SMTPHost" value="hostUrl" />

I add some mailaddress myMail.To.Add(to) and to contains mail addresses splited by ;


I think you need to split the addresses in to and add them one at a time

string[] addrs = to.Split(";");
foreach (string addr in addrs) {
    myMail.To.Add(addr);
}
0

精彩评论

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

关注公众号