当我使用SmtpClient类发送纯文本电子邮件时,传输编码设置为quoted-printable:
Content-Transfer-Encoding: quoted-printable
如何更改?
答案 0 :(得分:2)
使用AlternateView撰写邮件:
MailMessage message = new MailMessage("from@example.com", "to@example.com");
message.Subject = "Test";
AlternateView plainText = AlternateView.CreateAlternateViewFromString("test");
plainText.TransferEncoding = System.Net.Mime.TransferEncoding.SevenBit;
message.AlternateViews.Add(plainText);
message.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Send(message);