Dim msg As New MailMessage()
Dim EmailAdress As New MailAddress("admin@xxx.com")
Dim smtpmail As New SmtpClient()
msg.To.Add(txtEmail.Text)
msg.From = EmailAdress
msg.Subject = "COS Password"
'msg.BodyFormat = MailFormat.Html
'msg.BodyFormat = MailFormat.Text
smtpmail.Host = "smtp.gmail.com"
smtpmail.EnableSsl = True
smtpmail.Port = 587
smtpmail.Credentials = New System.Net.NetworkCredential("xxxx@gmail.com", "xxx")
msg.Body = "Your password for xxx website is : " & dtPassword.Rows(0)("Password")
smtpmail.Send(msg)
msg = Nothing
lblMsg.Text = "An Email has been send to " & txtEmail.Text
No comments:
Post a Comment