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.
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.
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);
}

The easiest would be loop through the dataset that you have bound to grid view. But since you have asked about gridview, here is how you can loop through gridview rows
On button_click write this
UPDATE 2
Updating my code to use your sendEmail function