System.Net.Mail.SmtpException: Failure sending mail

  • Thread starter Thread starter geoana
  • Start date Start date
G

geoana

Guest
Body text cannot contain images or links until we are able to verify your account. - HUH???????????????



VS17 Community VB.NET

The below code works with my ISP IF SSL=FALSE, fails with SSL=TRUE. Variables obviously don't appear to matter and are private, anyway. My ISP has 'calmly' informed me that since it is my software, they will not support me.

Somewhere on the web I noticed that this might be some Microsoft 'credentials' issue?

========================================

System.Net.Mail.SmtpException: "Failure sending mail."

Inner Exception

IOException: Unable to read data from the transport connection:

net_io_connectionclosed.

========================================

Private Sub xxxxx

Dim MailMessage As New MailMessage
Dim client As SmtpClient


If USE_SSL = True Then
SMTPServer.Port = 465
SMTPServer.EnableSsl = True
Else
SMTPServer.Port = 80
SMTPServer.EnableSsl = False
End If


SMTPServer.Host = Server_URL(SelectedServer)
SMTPServer.DeliveryMethod = SmtpDeliveryMethod.Network
SMTPServer.UseDefaultCredentials = False
SMTPServer.Credentials = New System.Net.NetworkCredential(Server_UserName(SelectedServer),
Server_Password(SelectedServer))
MailMessage.From = New MailAddress(".....")
MailMessage.To.Add(".....")
MailMessage.Subject = "Southern . . .. . . . Association Test Message"

MailMessage.Body = "This is a test message"

'send the message
SMTPServer.Send(MailMessage)

End Sub

The confusing fact is that with SSL=False, email is sent just fine, EXCEPT TO ROADRUNNER related accounts (which includes zzzzzz accounts which I believe Spectrum/TWC farms out to roadrunner) which makes me need SSL=TRUE to get emails thru roadrunner's isp.


Been fighting this for weeks.

George


Continue reading...
 
Back
Top