Send Email using Google SMTP in

Here is small function which will allow you to send the emails
programatically using any SMTP server or you can also use the Google
SMTP server if you have a GMAIL account.

Function SendMail(ByVal strFrom As String, ByVal strTo As String, ByVal
strSubject As String, ByVal strBody As String) As Boolean
Dim mailmsg As New System.Net.Mail.MailMessage()

mailmsg.From = New MailAddress(strFrom)


mailmsg.Subject = strSubject

mailmsg.IsBodyHtml = True

mailmsg.Body = strBody

mailmsg.Priority = System.Net.Mail.MailPriority.Normal

Dim client As New System.Net.Mail.SmtpClient()

client.Host = “”
client.Port = “587”

client.Credentials = New System.Net.NetworkCredential(““, “Yourpassword“)

‘ client.EnableSsl = True

Dim userstate As Object = mailmsg

Return True
End Function

Replace the email id and the password with your own  gmail id and your gmail password