title: Sending bulk emails in c # .net windows application
body: <p>My project is to send at least 100 mails an hour.</p>
  
  <p>I have used for loop to retrieve emails from database and send email one by one.</p>
  
  <p>But When I googled i find out that it will get time out after some time.So What is the method to use to hold the mail sending for a while and then restart the loop from hold position.Also,if the sending failed i should resend it.Should I use timer?</p>
  
  <p>Please provide me any idea to complete this.</p>
  
  <p>My sample code,</p>
  
  <pre><code>List&lt;string&gt; list = new List&lt;string&gt;();
          String dbValues;
          foreach (DataRow row in globalClass1.dtgrid.Rows)
          {
              //String From DataBase(dbValues)
              dbValues = row["email"].ToString();
  
              list.Add(dbValues);
  
  
          }
  using (System.Net.Mail.SmtpClient client = new System.Net.Mail.SmtpClient(mailserver, port))
          {
              client.Credentials = new System.Net.NetworkCredential(emailfrom, password);
              client.EnableSsl = true;
  
              MailMessage msg1 = new MailMessage();
              foreach (string row in list)
              {
                  if (row != null)
                  {
                      msg1=sendmail(row);
                      client.Send(msg1);
                      client.Dispose();
  }
  }}
  </code></pre>