Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
While receiving this mail in Gmail I am getting content transfer encoding as quoted-printable which results displaying mail in unreadable format for the user (base64 content without encoding), So How can I change Email content transfer encoding header value as base64


What I have tried:

var client = new System.Net.Mail.SmtpClient(ServerName, ServerPort);

MvcMailMessage mailMessage = new MvcMailMessage { Subject = "Subject" };
mailMessage.IsBodyHtml = true;
mailMessage.BodyEncoding = System.Text.Encoding.UTF8;
mailMessage.BodyTransferEncoding = System.Net.Mime.TransferEncoding.Base64;
message.From = "test@gmail.com"
message.Headers.Add("Content-Transfer-Encoding", "base64");
mailMessage.Attachments.Add(new Attachment(stream, "testfile"));

PopulateBody(mailMessage, viewName: "Emailview", linkedResources: resources);

client.Send(message);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900