Imports System.Net.Mail
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
Dim message As String
SmtpServer.Credentials = New Net.NetworkCredential(<EMAILID>,<PASSWORD>)
'Only Needed if Your SMTP Port is Not the Default One.
SmtpServer.Port = 587
SmtpServer.Host = <MAIL SERVER> (Eg. mail.yourdomainname.com)
mail = New MailMessage()
mail.From = New MailAddress(<EMAILID>)
mail.To.Add(reciever)
mail.Subject = <SUBJECT>
message = "Hello World"
mail.Body = message
'This blocks main thread until mail is sent
'SmtpServer.Send(mail)
'MsgBox("mail send")
Dim userState As Object = mail
'Do this if you want to handle event manually, otherwise follow the below statement for sending mail asynchronously i.e. by not blocking the main thread.
'wire up the event for when the Async send is completed
'AddHandler SmtpServer.SendCompleted, AddressOf SmtpClient_OnCompleted
SmtpServer.SendAsync(mail, userState)