title: eMail from asp.net c# program very slow
body: <p>I am sending a simple email message from an asp.net web page to two recipients. It's taking about 15 seconds to finish execution. Is it possible to speed this up? This is the code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Net.Mail;
  
  namespace NihulKriotNS.BLL
  {
  public class EMailClass
  {
      //fields
      private const string strFrom = "myEmail";
      private const string mailServer = "myServer";
      private const string userName = "myUserName";
      private const string usePass = "myPassword";
      //ctors
      public EMailClass()
      {
      }
  
      public void SendEMail(List&lt;string&gt; emailList, string strSubject, string  strMessage, bool isHTML)
                {
          MailMessage msg = new MailMessage();
          msg.From = new MailAddress(strFrom);
          if (emailList != null &amp;&amp; emailList.Count &gt; 0 )
              foreach (string em in emailList)
              {
                  msg.To.Add(em);
              }
          else
              return;
          msg.Subject = strSubject;
          msg.Body = strMessage;
          msg.IsBodyHtml = isHTML;
          SmtpClient smtp = new SmtpClient(mailServer);
          smtp.Credentials = new System.Net.NetworkCredential(userName, usePass);
  
  
          smtp.Send(msg);
          msg.Dispose();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I tried using smpt.SendAsync but didn't help at all. I'm not realy sure how to use it properly.
  Thank you very much.</p>