-8

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.

anni
  • 49
  • 1
  • 7
  • Please clarify what you mean? Do you just want to send an e-mail with an html body? If so, what does that have to do with reviews and ratings... or gmail for that matter? – Robba Nov 29 '16 at 09:39
  • 1
    Stackoverflow isn't your personal code writing service. Show us what you have tried so far and explain what your problem is. –  Nov 29 '16 at 09:39
  • Possible duplicate of [How to send HTML-formatted email?](http://stackoverflow.com/questions/8628683/how-to-send-html-formatted-email) – Minelli Nov 29 '16 at 09:41
  • 1
    Please refer- http://stackoverflow.com/help/how-to-ask – Souvik Ghosh Nov 29 '16 at 09:41

1 Answers1

0

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

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

try
{
msg = new MailMessage("xxxx@gmail.com",
    "yyyy@gmail.com", "Message from PSSP System",
    "This email sent by the PSSP system<br />" +
    "<b>this is bold text!</b>");

    msg.IsBodyHtml = true;

     sc.Send(msg);
}

catch (Exception ex)
{
    throw ex;
}

finally
{
    if (msg != null)
    {
        msg.Dispose();
    }
}

Use msg.IsBodyHtml = true;

Rahul Kumar
  • 2,184
  • 3
  • 24
  • 46