The SmtpClient.Send() method is throwing this exception when I try to send an email to an address containing an accentuated character (é):
System.Net.Mail.SmtpException: The client or server is only configured for e-mail addresses with ASCII local-parts: lé[email protected].
at System.Net.Mail.MailAddress.GetAddress(Boolean allowUnicode)
at System.Net.Mail.SmtpClient.ValidateUnicodeRequirement(MailMessage...)
at System.Net.Mail.SmtpClient.Send(MailMessage message)
The formulation of the message makes me thing there might be a setting that I can activate to make this work, though I haven't found anything on this subject.
I have tried several SMTP servers, including Gmail. Here are the relevant bits for a repro:
Code
var msg = new MailMessage();
msg.Subject = "Test";
msg.From = new MailAddress("[email protected]");
msg.To.Add(new MailAddress("lé[email protected]"));
new SmtpClient().Send(msg);
app.config
<system.net>
<mailSettings>
<smtp from="[email protected]">
<network host="smtp.gmail.com" port="587" userName="[email protected]" password="password" enableSsl="true" />
</smtp>
</mailSettings>
</system.net>