Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用带有 unicode 发件人名称的 smtp 客户端发送电子邮件。我尝试像这样添加发件人标头:
message.AddHeader("Sender", String.Format("{0} <{1}>", Name, email));
我得到“??????” 而不是发件人姓名。
var bytes = Encoding.UTF8.GetBytes(Name); var base64 = Convert.ToBase64String(bytes); message.AddHeader('Sender', String.Format("=?UTF-8?B?{0}?= <{1}>", base64, email));