5

I'm currently using MailSystem.NET SMTPClient to send email, the email content contains Chinese character in both Subject and Body. By the following code, I'm able to set the Email's body to be Encoded correctly, but Subject is still not Encoded and appeared as ???? in Received Email.

 ActiveUp.Net.Mail.Message message = new ActiveUp.Net.Mail.Message();
 ....
 message.Charset = "utf-8";
 SmtpClient.Send(message, serverName);

Could anyone familiar with MailSystem.Net kindly tell me how to set the subject as encoded in utf-8 as well? Thanks.

4

1 回答 1

15

我的电子邮件主题中的波兰字符也有类似的问题。以这种方式解决它(VB.NET):

message.Subject = "=?UTF-8?B?" &
    Convert.ToBase64String(Encoding.UTF8.GetBytes(outboxMessage.Title)) &
    "?="

现在一切都按预期工作。

于 2013-07-17T09:57:37.197 回答