Encoding Special Characters For Outlook HTML Email
I have an asp.net / C# page which takes a comment, and then emails that comment. Sometimes when the user enters "&" in the comment, the comment is being truncated. So for example if the comment is "开发者_JAVA技巧test & test" the email only sends out "test ".
I have tried HttpUtility.HtmlEncode - but it looks like the issue is on the outlook side and not on the C# side.
Why not just specify the email format to be plain text?
MailMessage mail = new MailMessage();
mail.IsBodyHtml = false;
How is the comment being entered? TextBox ?
Make sure that the ASP.NET page that is sending the email gets the text correctly and it is not truncated before. The issue seems surprisingly like if the comment is not URL encoded correctly and the page receives only the first part as a parameter.
精彩评论