anni anni - 1 year ago 106
ASP.NET (C#) Question

How to send mail using C# with html format

hello how to take reviews and rating from mail in c#?How to use html format for gmail.i have given link to review when i click on it it redirect me to next page that is Mail.aspx. so how can i send my rating and mail.aspx file in mail and i want my result to be store in database.

Answer Source

Setting isBodyHtml to true allows you to use HTML tags in the message body:

SmtpClient sc = new SmtpClient("mail address");
MailMessage msg = null;

msg = new MailMessage("",
    "", "Message from PSSP System",
    "This email sent by the PSSP system<br />" +
    "<b>this is bold text!</b>");

    msg.IsBodyHtml = true;


catch (Exception ex)
    throw ex;

    if (msg != null)

Use msg.IsBodyHtml = true;

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download