Thursday, July 14, 2011

MailMessage - Allowing html tags inside body text

Problem


This is the very simple scenario required when sending email from our application. We need to put html tags in the body of the text which we are sending.


We are expected to send the email with the above body. This should be appear in their inbox with two lines. The text "Dear Murugesan," should come in the first line and the rest in second line.

Solution

Normally this won't appear as we wish. We need to true the property named "IsBodyHtml". Look at the below code sample,

The above picture clearly shows the how to enable the property to get the work done.

Keep .Neting...

No comments:

Post a Comment