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
Dim mail As New MailMessage() mail.From = New MailAddress("email@example.com") mail.To.Add("firstname.lastname@example.org") 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("email@example.com", "password") smtp.Send(mail)