title: send smtp mail including html to gmail account
body: <p>I've found this small code that sends email to gmail users. I'd like the body of the mail to contain html (for example, decoding a link for it to hold different text than the url it's pointing to).</p>
  
  <p>I am using c# .net 3.5. I've used these classes in my code:</p>
  
  <ul>
  <li>MailMessage </li>
  <li>SmtpClient</li>
  </ul>
  
  <p>How can this be done?</p>
  
  <p>Here's a copy of my code:</p>
  
  <pre><code>            MailMessage message = new MailMessage("me@gmail.com", WebCommon.UserEmail, "Test", context.Server.HtmlEncode("&lt;html&gt; &lt;body&gt; &lt;a href='www.cnn.com'&gt; test &lt;/a&gt; &lt;/body&gt; &lt;/html&gt; "));
              System.Net.NetworkCredential cred = new System.Net.NetworkCredential("him@gmail.com", "myPwd");
              message.IsBodyHtml = true;
  
              System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
  
              smtp.UseDefaultCredentials = false;
              smtp.EnableSsl = true;
              smtp.Credentials = cred;
              smtp.Port = 587;
  
              smtp.Send(message);
  </code></pre>
  
  <p>Thanks!</p>