title: Porting System.Web.Mail functionality to System.Net.Mail
body: <p>The following function works perfectly:</p>
  
  <pre><code>    protected void SendWebMailMessage(string DisplayName, string From, string ReplyTo,
          string To, string Subject, string Body, string Attachments)
      {
          System.Web.Mail.MailMessage msg = new System.Web.Mail.MailMessage();
          msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver",
               "smtpout.secureserver.net");
          msg.Fields.Add(
               "http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25);
          msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 
               2);
          msg.Fields.Add(
               "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1);
          msg.Fields.Add(
               "http://schemas.microsoft.com/cdo/configuration/sendusername", From);
          msg.Fields.Add(
               "http://schemas.microsoft.com/cdo/configuration/sendpassword",
               mailpassword);
          msg.To = To;
          msg.From = DisplayName + "&lt;" + From + "&gt;";
          msg.BodyFormat = MailFormat.Html;
          msg.Subject = Subject;
          msg.Body = Body;
          msg.Headers.Add("Reply-To", ReplyTo);
          SmtpMail.SmtpServer = "smtpout.secureserver.net";
          SmtpMail.Send(msg);
      }
  </code></pre>
  
  <p>However, I get a build warning telling me that System.Web.Mail is obsolete, and 
  that I should be using System.Net.Mail. So I used System.Net.Mail, and I came up with 
  the following function to replace my old one:</p>
  
  <pre><code>    protected void SendNetMailMessage(string DisplayName, string From, string ReplyTo, 
          string To, string Subject, string Body, string Attachments)
      {
          MailAddress addrfrom = new MailAddress(From, DisplayName);
          MailAddress addrto = new MailAddress(To);
          MailAddress replytoaddr = new MailAddress(ReplyTo);
          System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
          msg.From = addrfrom;
          msg.To.Add(addrto);
          msg.ReplyTo = replytoaddr;
          msg.IsBodyHtml = true;
          SmtpClient smtp = new SmtpClient("smtpout.secureserver.net");
          smtp.Credentials = new NetworkCredential(From, mailpassword);
          smtp.Send(msg);
      }
  </code></pre>
  
  <p>I don't get any exceptions or errors, but my message never goes through. Can anyone 
  tell me what I might be doing wrong? Thanks in advance.</p>