I have a datagridview and it has 5 rows and I have bind it from database. I am sending an email and i want to show dynamically in satus column only "Sent". I dont want to update and insert any value in database. I want to do it from code only. What I have tried: I have tried so far. <pre>public void sendMail() { foreach (DataGridViewRow rows in grdsend.Rows) { var subject = rows.Cells[0].Value.ToString(); var content = rows.Cells[1].Value.ToString(); var from = rows.Cells[2].Value.ToString(); var senderPassword = rows.Cells[3].Value.ToString(); var senderID = rows.Cells[4].Value.ToString(); var to = rows.Cells[5].Value.ToString(); var date = rows.Cells[6].Value.ToString(); var status = rows.Cells[7].Value = "Sending"; // Now i want status variable value "Sending" to show in datagridview cell MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.To.Add(to.ToString()); mail.Subject = subject.ToString(); mail.Body = content.ToString(); mail.From = new MailAddress(from.ToString()); SmtpServer.Port = 587; SmtpServer.EnableSsl = true; SmtpServer.Credentials = new System.Net.NetworkCredential(from.ToString(), senderPassword.ToString()); SmtpServer.Send(mail); MessageBox.Show("Mail sent"); } }
MessageBox.Show("Mail sent");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)