Sub SendGoogleMail(ByVal myFromAddress As String, ByVal myFromAddressDisplay As String, ByVal myToAddress As String, ByVal mySubject As String, ByVal myBody As String, ByVal ID As String, ByVal Password As String)
Dim myMessage As New MailMessage
Dim SMTPSERVER As New SmtpClient
myMessage.From = New MailAddress(myFromAddress, myFromAddressDisplay)
myMessage.ReplyTo = New MailAddress(myFromAddress)
myMessage.To.Add(New MailAddress(myToAddress))
myMessage.Cc.Add(New MailAddress(myCCAddress))
myMessage.Bcc.Add(New MailAddress(myBCCAddress))
myMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
myMessage.IsBodyHtml = True
myMessage.Priority = MailPriority.High
myMessage.Subject = mySubject
myMessage.Body = myBody
SMTPSERVER.DeliveryMethod = SmtpDeliveryMethod.Network
SMTPSERVER.Host = "smtp.gmail.com"
SMTPSERVER.EnableSsl = True
SMTPSERVER.Port = 587
Dim basicAuthenticationInfo As New System.Net.NetworkCredential(ID, Password)
SMTPSERVER.Credentials = basicAuthenticationInfo
SMTPSERVER.Send(myMessage)
myMessage.Dispose()
myMessage = Nothing
SMTPSERVER = Nothing
End Sub