Sub Page_Load(sender As Object, e As EventArgs)
Dim myMail As New System.Net.Mail.MailMessage()
Dim Cred As New System.Net.NetworkCredential("[email protected]", "password")
myMail.To.Add("[email protected]")
myMail.Subject = "Test send mail message"
myMail.From = New System.Net.Mail.MailAddress("[email protected]")
myMail.IsBodyHtml = True
myMail.Body = "Hi Sawatdee.<br><br>Sabye dee mai."
Dim SmtpMail As New System.Net.Mail.SmtpClient("smtp.gmail.com")
SmtpMail.UseDefaultCredentials = False
SmtpMail.EnableSsl = True
SmtpMail.Credentials = Cred
SmtpMail.Port = 465
SmtpMail.Send(myMail)
myMail = Nothing
Me.lblText.Text = "Mail Sending."
End Sub