title: C# Sending SMTP using System.Threading
body: <p>I have developed an application which primarily sends email messages uses SMTP. Sending messages one by one is fine, however I am looking to speed the process. I have created multiple instances of the <code>SmtpClient</code> as well as messages to avoid conflict among each other. Because of the separate instances, I assumed performing <code>.Send()</code> on multiple threads would work well. However, something with my <code>Thread</code> code alone is not working, because I can not send even one email on one thread using this code. I simply receive a vague <code>"Failure sending mail"</code> exception. I will post code that works, and the <code>Thread</code> that does not work. Could someone share what they believe may be the cause?</p>
  
  <p><strong>Note</strong> I am not currently looking to use the newer <code>async</code> capabilities but instead leveraging <code>Thread</code></p>
  
  <p><strong>Working Declaration and Method Call:</strong></p>
  
  <pre><code>var SMTP = new SmtpClient
      {
          Host = txtBxSenderHost.Text,
          Port = 587,
          EnableSsl = true,
          DeliveryMethod = SmtpDeliveryMethod.Network,
          UseDefaultCredentials = false,
          Credentials = new NetworkCredential(strSenderAddress, strSenderPassword)
      };
  
  using (var message = new MailMessage(senderAdrress, toAddress)
      {
          Subject = strSubject,
          Body = strBody
      })
  
      {
          SMTP.Send(message);
      }
  </code></pre>
  
  <p><strong>NOT Working Thread declaration and Method Call:</strong></p>
  
  <pre><code>var SMTP = new SmtpClient
      {
          Host = txtBxSenderHost.Text,
          Port = 587,
          EnableSsl = true,
          DeliveryMethod = SmtpDeliveryMethod.Network,
          UseDefaultCredentials = false,
          Credentials = new NetworkCredential(strSenderAddress, strSenderPassword)
      };
  
  using (var message = new MailMessage(senderAdrress, toAddress)
      {
          Subject = strSubject,
          Body = strBody
      })
  
      {
          Thread T1 = new Thread(delegate() { SMTP.Send(message); } );
          T1.Start();
      }
  </code></pre>