简体   繁体   中英

how to set Content-Transfer-Encoding as 8-bit in asp.net

i am sending mail from my asp.net application using c#.

a part of my code

  Message.SubjectEncoding = Message.BodyEncoding = System.Text.Encoding.UTF8;

this sends the charset =utf-8 but Content-Transfer-Encoding :base64

i have gone through Problem sending email with SmtpClient in C# but i have not found how to set Content-Transfer-Encoding as 8-bit

I know this is an old question, but it is an interesting one.

I have found a solution here: https://idevelopdotnet.wordpress.com/2009/03/04/content-transfer-encoding-systemnetmailmailmessage/

Basically, you have to use AlternateViews, as then you can set the Content-Transfer-Encoding. To 7bit only though, not 8bit, but that was good enough for me.

I am not sure why MS made such a mess, but took me hours and hours of finding the right recipe for sending both HTML and plain text the way they should be sent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM