We are using SmtpClient.Send to send mail. But unfortunately the mail body which is having some special character like "æ", "ø" and "å" (and many such) are not getting send properly and on reciept those character is getting corrupted.

Any help will be appreciated.

Regards, Paddy

有帮助吗?

解决方案

The default encoding used by SmtpClient.Send is us-ascii. You need to use the override that receives a MailMessage and set the message's BodyEncoding property to an encoding that contains the special characters you need. You can do the same for the SubjectEncoding property, to encode special characters in the Subject.

You can use a Unicode encoding but the documentation warns that your message's TransferEncoding will be converted to Base64. Almost all email clients can handle this, so I don't thing this will be an issue.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top