The specified string is not in the form required for an e-mail address
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);
}
精彩评论