Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
Dim myMail As New MailMessage()
myMail.From = New MailAddress("[email protected]")
myMail.To.Add(New MailAddress(Me.txtTo.Text))
myMail.Subject = Me.txtSubject.Text
myMail.Body = Me.txtMessage.Text
myMail.Priority = MailPriority.High ' MailPriority.High , MailPriority.Low MailPriority.Normal
Dim Client As New SmtpClient()
'Client.Host = "192.168.0.1"
Client.Send(myMail)
MessageBox.Show("Mail Send Complete!")
End Sub
.NET Windows Form กับการส่งอีเมล์ (Send Mail) แบบง่าย ๆ ด้วย System.Net.Mail (VB.NET , C#)