title: System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed
body: <p>I'm trying to send a mailing list to 500 customer via Gmail for a client, the problem is it only sends 89 and then I get the following error:</p>
  
  <blockquote>
    <p>System.IO.IOException: Unable to read data from the transport
    connection: net_io_connectionclosed</p>
  </blockquote>
  
  <p>The code I have does work when I send the 500 to local pickup.</p>
  
  <p>I have read many post on this and the client says she has a limit of 2000 email per day, so I do not know what the problem is.</p>
  
  <p>Can anyone give some insight into this.</p>
  
  <p>Code </p>
  
  <pre><code>var emailMessage = new MailMessage();
                  emailMessage.To.Add(new MailAddress(emailRecipicant,customerName.Trim()));
                  emailMessage.From = new MailAddress(smtpEmail);
                  emailMessage.Subject = $"{emailSubject}";
                  emailMessage.Body = string.Format(body);
                  emailMessage.IsBodyHtml = true;
  
  
  
                  using (var smtp = new SmtpClient())
                  {
                      smtp.UseDefaultCredentials = false;
                      var credential = new NetworkCredential
                      {
                          UserName = smtpUsername,
                          Password = smtpPassword
                      };
                      smtp.Credentials        = credential;
                      smtp.Host               = smtpHost;
                      smtp.Port               = Convert.ToInt32(smtpPort);
                      smtp.DeliveryMethod     = SmtpDeliveryMethod.Network;
                      //smtp.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory;
                      //smtp.PickupDirectoryLocation = "C:\\Users\\pht_000\\Desktop\\Customers\\Email\\PickUp\\";
                      smtp.EnableSsl          = false;
                      smtp.Send(emailMessage);
                  }
  </code></pre>
  
  <p>The above void method is looped over via the following</p>
  
  <pre><code>foreach (var recipicant in model.ToList())
                      {
                          string emailRecipicant = recipicant.Email;
                          string emailSubject = recipicant.Subject;
                          string message1 = recipicant.Message;
                          string encryptedLink = recipicant.EncryptedEmail;
                          string customerName = recipicant.Contact;
                          SendEmail(emailRecipicant, emailSubject, message1, encryptedLink, customerName);
  
                          counter++;
                      }
  </code></pre>