For 10 years I've used same code - very similar to that which follows. All of a sudden I'm getting an error: "Mailbox Unavailable 5.5.1 Authentication required".
Using VB.net, my code:
Imports System
Imports System.IO
Imports System.Net.Mail
Public Class Form1
Private Sub btnSend_Click(sender As Object, e As EventArgs) Handles btnSend.Click
Dim strMyMailAddress As String
Dim strMyPassword As String
Dim strRecipient As String
Dim SmtpServer As New SmtpClient()
SmtpServer.Credentials = New Net.NetworkCredential(strMyMailAddress, strMyPassword)
SmtpServer.Host = "smtpauth.earthlink.net"
SmtpServer.EnableSsl = False
SmtpServer.Port = 587
Dim mail As New MailMessage()
mail = New MailMessage()
Try
mail.From = New MailAddress(strMyMailAddress, "Pick A Name", System.Text.Encoding.UTF8)
mail.To.Add(strRecipient)
mail.Subject = "Test Send"
mail.Body = "Test Send E-Mail Body Text"
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
SmtpServer.Send(mail)
MsgBox("Done")
Catch ex As Exception
MsgBox(ex.ToString())
End Try
Me.Close()
End Sub
End Class
What I have tried:
With very minor modification, this works on Outlook and Gmail servers (just Earthlink has gone hay-wire). I've tried changing passwords, order of server properties access via alternative e-mail accounts and more. Any ideas?