I just spent 5 hours debugging a similar problem, and the solution I found might be the solution to this problem. Since no one posted any other solutions, I will make my conclusions.
There is a subtle error in the .NET2.0 Mail API, which causes the encoding of recipient names in message headers to fail. This happens if the To object (and possibly others) of the MailMessage instance is accessed before the message is sent.
In the following example, the To header will be sent without encoding, which will cause at least my mail client to display the name as "?????? ...":
MailMessage message = new MailMessage(); message.To.Add(new MailAddress(" address@example.com ", "ΓΓΓ
Unicode Name")); message.Subject = "Subject"; message.Body = "Body"; Console.WriteLine(message.To[0]); smtpClient.Send(message);
However, moving the WriteLine under the send line causes the To header to be correctly encoded:
MailMessage message = new MailMessage(); message.To.Add(new MailAddress(" address@example.com ", "ΓΓΓ
Unicode Name")); message.Subject = "Subject"; message.Body = "Body"; smtpClient.Send(message); Console.WriteLine(message.To[0]);
I assume that this error will be in the properties of Cc and Bcc, so beware of this. Hope someone finds this helpful.
source share