title: sending email based on a gridview column containing email addresses
body: <p>May I know how to send email based on gridview column containing email addresses?
  I am currently using asp.net and c#. I'm also currently using smtp gmail for the email. </p>
  
  <p>Currently, I had a gridview1 which contain customers (email, name, accountNo) that had bounced cheque, however I wish to send an standard email, to all these customers upon clicking a button. May I know how should i go about it? Their email is stored in database and will be shown on gridview. </p>
  
  <pre><code>   private void SendEMail(MailMessage mail)
  {
      SmtpClient client = new SmtpClient();
      client.Host = "smtp.gmail.com";
      client.Port = 587;
      client.EnableSsl = true;
      client.Credentials = new System.Net.NetworkCredential("@gmail.com", "password");
  
      try
      {
          client.Send(mail);
      }
      catch (Exception ex)
      {
          Console.WriteLine("{0} Exception caught.", ex);
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/otkPK.png" alt="enter image description here"></p>