views:

292

answers:

2

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 "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.

A: 

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 ?

Nick Allen - Tungle139
I need the email to be in HTML format for formatting purposes.
n0chi
A: 

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.

Darin Dimitrov
n0chi