Manoj Bisht

Manoj Bisht

  • NA
  • 145
  • 0

Email in ASP.NET

Sep 11 2007 11:04 AM
Hello Everyone,

I'm sending mail through ASP.NET and it's rocking. But whenever i'm trying to send the text given below then an error is occuring

"Some formatted text like bold italic and etc"



Actually i'm creating my own emailEditor through which i can bold,italic and etc. facilities being provided.

And it's working great but as i'm sending normal text it's but as i provide some formatted text it's not..................

The code i'm giving below for sending mail.........


//For Sending The Mail
MailMessage mail1=new MailMessage();
mail1.To="[email protected]";

//mail1.From="[email protected]";
mail1.From="[email protected]";

mail1.Subject="Mail From Manoj Bisht";
mail1.Priority=MailPriority.High;

mail1.BodyFormat=MailFormat.Html;
string body=HtmlTextArea.Value;

mail1.Body=body.ToString();


try
{

SmtpMail.SmtpServer="127.0.0.1";
SmtpMail.Send(mail1);

lblMsg.Text="Mail Sent Successfully";
lblMsg.ForeColor=Color.DarkBlue;

}
catch(Exception ex)
{
lblMsg.Text=ex.Message.ToString();
lblMsg.ForeColor=Color.Red;
}





And the following error occuring
A potentially dangerous Request.Form value was detected from the client (HtmlTextArea="Manoj Bis...").

Answers (1)