Getting an error when sending email through Gmail SMTP
问题 Basically I have attempted to send an email when a button is pressed. With the following code, I get an error that says something about 'The SMTP server requires a secure connection or the client was not authenticated'. What is causing this error? Imports System.Net.Mail Private Sub Button1_Click_2(sender As Object, e As EventArgs) Handles Button1.Click Try Dim SmtpServer As New SmtpClient() Dim mail As New MailMessage() SmtpServer.Credentials = New _ Net.NetworkCredential("MYEMAIL@gmail.com"