title: Is there any way to close mail smtp session?
body: <p>I am using Gmail STMP server to send emails. It works just fine. But from few days, it sometimes stops working. Now, it is only working <code>5 out of 10</code> times.</p>
  <p>Exception: <code>Failure Sending Email</code></p>
  <p>Inner Exception: <code>Unable to connect to remote server.</code></p>
  <p>After talking to hosting technical support, they said there is a mail session limit on their server. This is a <code>Shared Hosting</code>, so when it exceeds all new connections are blocking. They said they are trying to fix it. But also said please check that you are <code>closing the mail session properly or not</code>.</p>
  <p>I looked into it, but there is no <code>Close()</code> or <code>Dispose()</code>. I also read there is no acknowledgement for SMTP tranfer?</p>
  <p>Please let me know if there is anyway to close the mail session? Or any workaround to fix this issue.</p>
  <p><strong>Update</strong></p>
  <p>I am using <code>System.Net.Mail</code></p>
  <blockquote>
  <p>MailMessage msg = new MailMessage();</p>
  <p>SmtpClient sc = new SmtpClient(&quot;smtp.gmail.com&quot;, 587);</p>
  <p>NetworkCredential info = new NetworkCredential(&quot;email&quot;, &quot;password&quot;);</p>
  </blockquote>
  <p>Then there is another method which calls <code>sc.Send()</code>.</p>