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("firstname.lastname@example.org") mail.To.Add("email@example.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("firstname.lastname@example.org", "password") smtp.Send(mail)