This code should work just fine but when I'm debugging it but it gives me this error every time I try to send the message"A first chance exception of type 'System.Net.Mail.SmtpException' occurred in System.dll". There is no elaboration on the error. That is all I get.
Code:
Dim MyMailMessage As New MailMessage()
Try
MyMailMessage.From = New MailAddress("[email protected]")
MyMailMessage.To.Add("[email protected]")
MyMailMessage.Subject = "Rabid Rabi"
MyMailMessage.Body = TextBox3.Text + TextBox4.Text
Dim SMTP As New SmtpClient("smtp.gmail.com")
SMTP.Port = 486
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential("[email protected]", "DICKSEVERYWHERE")
SMTP.Send(MyMailMessage)