hi guys, basically im making a program that sends an email to the user which has the score of the test he has done, it worked previously but now it is starting to say this error for some reason which is "The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required. " and i cant understand why. * note: this didnt happen before ![:/]()
Dim SMTP As New SmtpClient("smtp.gmail.com") ' this declares the smtp server name
Dim SmtpServer As New SmtpClient()
Dim mail As New MailMessage()
mail.Subject = "Biol Aid Answer Results"
mail.To.Add(TextBox1.Text)
mail.From = New MailAddress(TextBox2.Text)
mail.Body = "Student Name: " & "signinform.textbox1" & vbNewLine & "Section:" & "Populations" & vbNewLine & "Score:" & " quesnum " ' this is what the message will be.
SmtpServer.EnableSsl = True
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text) 'username and password
SMTP.Port = "587" 'this is the google mail port number
SMTP.Send(mail) 'this sends the message