0

im trying to send email from vb.net get error msg .... "The SMTP" server require scour connection or the client was not authenticated"

Dim Smtp_Server As New SmtpClient
Dim e_mail As New MailMessage()
Smtp_Server.UseDefaultCredentials = False
Smtp_Server.Credentials = New Net.NetworkCredential("ejazsarwar110@gmail.com", "*******")
Smtp_Server.Port = 587
Smtp_Server.EnableSsl = True
Smtp_Server.Host = "smtp.gmail.com"

e_mail = New MailMessage()
e_mail.From = New MailAddress("ejazsarwar110@gmail.com", "Ejaz Sarwar")
e_mail.To.Add("ajaz661@yahoo.com")
e_mail.Subject = "Email Sending"
e_mail.IsBodyHtml = False
e_mail.Body = txtSunCovered.Text
Smtp_Server.Send(e_mail)
MsgBox("Mail Sent")
jmcilhinney
  • 50,448
  • 5
  • 26
  • 46
  • @jmcilhinney for advise ... – Ejaz Sarwar Sep 26 '19 at 09:58
  • Possible duplicate of [The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.?8](https://stackoverflow.com/questions/29074463/the-smtp-server-requires-a-secure-connection-or-the-client-was-not-authenticated) – Ryan Roos Sep 26 '19 at 15:15

0 Answers0