Hi all,
I found this tutorial very easy and understandable. I followed it's instructions but following exception was thrown:
I turned off my email two-step verification but according to https://myaccount.google.com/lesssecureapps, this item is no longer supported.
Code for record:
- How can I rectify the matter?Code:Imports System.Net.Mail Public Class Form2 Private Sub SendBtn_Click(sender As Object, e As EventArgs) Handles SendBtn.Click Me.Cursor = Cursors.WaitCursor GroupBox1.Enabled = False Try Dim SMTP_SERVER As New SmtpClient Dim E_MAIL As New MailMessage SMTP_SERVER.UseDefaultCredentials = False SMTP_SERVER.Credentials = New Net.NetworkCredential(Usertxt.Text, Passtxt.Text) SMTP_SERVER.Port = 587 SMTP_SERVER.EnableSsl = True SMTP_SERVER.Host = "smtp.gmail.com" E_MAIL = New MailMessage E_MAIL.From = New MailAddress(Usertxt.Text) E_MAIL.To.Add(Addresstxt.Text) E_MAIL.Subject = Subjecttxt.Text E_MAIL.IsBodyHtml = False E_MAIL.Body = Messagetxt.Text SMTP_SERVER.Send(E_MAIL) Me.Cursor = Cursors.Default GroupBox1.Enabled = True MsgBox("Successfully sent.", MsgBoxStyle.Information) Catch ex As Exception Me.Cursor = Cursors.Default MsgBox(ex.Message.ToString, MsgBoxStyle.Critical) GroupBox1.Enabled = True Addresstxt.Focus() End Try End Sub End Class
- What does the 'server response was: 5.7.0' mean?




Reply With Quote
