idrissa camara

idrissa camara

  • NA
  • 385
  • 0

Sending automated mail from GridView to existing column in the database

Oct 10 2012 4:44 PM
  Private Sub ASPxGridView1_RowUpdated(sender As Object, e As DevExpress.Web.Data.ASPxDataUpdatedEventArgs) Handles ASPxGridView1.RowUpdated
  'send a new confirmation email
  Dim EmailMsg As New MailMessage()
  EmailMsg.From = New MailAddress("[email protected]", "My CompanyName")
  EmailMsg.[To].Add(New MailAddress("[email protected]", "Customer info"))
  EmailMsg.[CC].Add(New MailAddress("[email protected]", "My Company help desk"))
  EmailMsg.Subject = "Close ticket notification"
  EmailMsg.Body = "<html><body>Microix : thank you for your business</body></html>"
  EmailMsg.IsBodyHtml = True
  EmailMsg.Priority = MailPriority.Normal
  Dim MailClient As New SmtpClient("smtp.gmail.com", 587)
  MailClient.EnableSsl = True
  MailClient.Credentials = New System.Net.NetworkCredential("[email protected]", "mycompany")
  MailClient.Send(EmailMsg)
  End Sub
this code behind of a gridview called ASPxGridView1 send an automated email to me at ([email protected]) upon clicking on update button as long as
I insert my email address in line
EmailMsg.[To].Add(new MailMessage("[email protected]"), ....
That is fine but what I want is to substitute my email ContactEmail on the gridView that being edit
in such a way the same line will look more like :
EmailMsg.[To].Add(New MailAddress("ContactEmail", "Customer info"))
ContactEmail being an existing column in the database