title: How to Send Mail to Multi Recipient With Multi SMPT'S?
body: <p>Hello to all the master I am new to C# and trying to make a mail sender which can send e mails to many recipient with a bunch of SMTP'S , USING SMTP'S one by one To send them messages</p>
  <p>THE CODE I AM USING TO DO SO!!</p>
  <pre><code>       private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
      {
  
          CheckForIllegalCrossThreadCalls = false;
  
          SmtpClient client = new SmtpClient();
          client.Timeout = 30000;
          client.AuthenticationMechanisms.Remove(&quot;XOAUTH2&quot;);
  
  
  
          BodyBuilder builder = new BodyBuilder();
          builder.HtmlBody = textBoxHTMLBody.Text;
  
  
          MimeMessage mail = new MimeMessage();
          mail.Subject = textBoxSubject.Text;
          mail.Body = builder.ToMessageBody();
  
  
          client.Connect(textBoxSMTP.Text, int.Parse(textBoxPORT.Text), CheckBoxSSL.Checked);
          client.Authenticate(textBoxUser.Text, textBoxPassword.Text);
          
         
  
          foreach (string email  in listBoxEMails.Items)
          {
  
  
  
              mail.From.Add(new MailboxAddress(&quot;hello&quot;, textBoxUser.Text));
              mail.To.Add(new MailboxAddress(&quot;&quot;,email));
              client.Send(mail);
  
  
              Thread.Sleep(1000);
          }
  
  
  
          client.Disconnect(true);
  
  
  
      }
  </code></pre>
  <p>this is the code i am using for sending mails from only one smtp and i am stuck , that how can i send e mails  with many SMTP'S</p>
  <p><a href="https://i.stack.imgur.com/R1uI4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R1uI4.png" alt="THIS THE THE IMAGE FOR THE SMTP SETUP " /></a></p>
  <p>By using data grid I created this form and I want to send E MAILS USING Datagridview1 data</p>
  <p>means instead of using text box . I want to use each Row as smtp data from data grid as server , port , user and pass for smtp in above code.
  What should be the changes to make it real</p>
  <p>Thanks to all the masters in advance !!!</p>