Hi, I need help with sending an email through gmail from a program. I substituted email adresses and passwords with generic names, this program works up to the last line where it fails to send the email. Any ideas as to why this may be?
This is using
imports system.net.mail
btw
Dim mail As New MailMessage()
mail.From = New MailAddress("email1@gmail.com")
mail.To.Add("email2@gmail.com")
mail.Subject = "This is an email"
mail.Body = "this is the body content of the email."
Dim smtp As New SmtpClient("smtp.gmail.com")
smtp.Credentials = New Net.NetworkCredential("email1@gmail.com", "password")
smtp.Send(mail)