Pesquisar_Items pesquisar = new Pesquisar_Items(); var client = new SmtpClient("smtp.gmail.com", 587); client.EnableSsl = true; client.Credentials = new NetworkCredential("jpbritopoker@gmail.com", "***"); var mail = new MailMessage(); mail.From = new MailAddress("nervir@epnervir.com"); mail.To.Add(textBox1.Text); mail.IsBodyHtml = true; mail.Subject = textBox2.Text; string mailBody = "<table width='100%' style='border:Solid 1px Black;'>"; ; foreach (DataGridViewRow row in itemDataGridView.Rows) { mailBody += "<tr>"; foreach (DataGridViewCell cell in row.Cells) { mailBody += "<td>" + cell.Value + "</td>"; } mailBody += "</tr>"; } mailBody += "</table>"; //your rest of the original code mail.Body = mailBody; client.Send(mail); MessageBox.Show("O email foi enviado com sucesso"); this.Close();
mail.To.Add("email2," + textBox2.Text + ", email3,email4")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)