title: An asynchronous module or handler completed while an asynchronous operation was still pending
body: <p>I had the following for emailing, which worked: </p>
  
  <pre><code>    private SmtpClient _client = new SmtpClient("smtp.gmail.com", 587)
      {
          Credentials = new NetworkCredential("address@gmail.com", "password"),
          EnableSsl = true
      };
      public void DoThis(){
      _client.Send("from@gmail.com", to.Email, "Subject", "Body");}
      public void DoThat(){
      _client.Send("from@gmail.com", to.Email, "Subject", "Body");}
  </code></pre>
  
  <p>But it was blocking the web application until the email was sent, so I decided to try sending Asynchronously: </p>
  
  <pre><code>   public void DoThis(){
      var message = new MailMessage("from@gmail.com", to.Email, "Subject", "Body");
     _client.SendAsync(message, null);
     }
  </code></pre>
  
  <p>Which I can see getting treated asynchronously if I debug, but I always get the following: </p>
  
  <blockquote>
    <p>An asynchronous module or handler completed while an asynchronous
    operation was still pending.</p>
  </blockquote>
  
  <p>What am I doing wrong?</p>