title: SMTP.SendMail Error - An existing connection was forcibly closed by the remote host
body: <p>I am trying to send email using the following code and get the error above.</p>
  
  <p>There is two emails being sent the first one seems to get delivered fine, the code below doesn't seem to work.</p>
  
  <p>Can anyone help please?</p>
  
  <pre><code>        using (var mail = new MailMessage(fromEmail.Trim(), ToEmail.Trim()))
          {
              mail.IsBodyHtml = true;
  
              bodyText = bodyText.Replace("**Message**", Message);
  
              // populate the message
              mail.Subject = subject;
              mail.Body = bodyText;
  
              // send it
              var smtpClient = new SmtpClient();
              smtpClient.Send(mail);
          }
  </code></pre>
  
  <p>The config:</p>
  
  <pre><code>  &lt;system.net&gt;
      &lt;mailSettings&gt;
        &lt;smtp from="test@foo.com"&gt;
          &lt;network defaultCredentials="true" port="25" host="127.0.0.1" password="" userName=""/&gt;
        &lt;/smtp&gt;
      &lt;/mailSettings&gt;
    &lt;/system.net&gt;
  </code></pre>