The server response was: 503 This mail server requires authentication when attempting to send to a non-local e-mail address

I am not sure why now I am getting this error all of a sudden.  Our ISP had changed some of their mail server around, and I think this should still work but it's not:

    Public Function SendMail(ByVal userid As String) As Boolean
        Dim obUser As New BusinessLayer.BUser
        Dim obMail As New Web.Mail.MailMessage
        obMail.To = obUser.Email
        obMail.From = " "
        obMail.Subject = "New Registration"
        obMail.BodyFormat = MailFormat.Html
        obMail.Body = "<b>Note : This mail is autogenerated. So do not reply.</b>" & _
            "<br>Dear " & obUser.FirstName & " " & obUser.MiddleName & " " & obUser.LastName & ",<br><br>" & "Thanks for registering with us." & _
            "<br><br>Your user name is <b>" & obUser.Email & "</b><br><br> Password is <b>" & obUser.Password & "</b><br><br>" & _
            "Please visit <a href=''></a> to login and " & _
            "access your account.<br><br>"
        SmtpMail.SmtpServer = "mail." & System.Configuration.ConfigurationSettings.AppSettings("DomainNameDisplay")
        obMail = Nothing
    End Function

ERROR: The server rejected one or more recipient addresses. The server response was: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This error occurs when you have not authenticated to the SmtpServer. Your paticular SMTP server will allow you to send e-maisl to anyone else who is on the same SMTP server without authenticating but not to anyone who is outside of the SMTP server.

There are several ways to authenticate to SMTP servers using .Net, you will find lots of articles on Google. But if you are using the .NET 2.0 framework the easiest way is to add the following into your web.config file:

This should be inserted after the <Configuration> section:
        <network host="mySMtpServer" port="25" userName="myUserName" password="myPassword" />

Obviosuly you need to replace the "my" settings with your own settings. There is an article/documentation available on this here: or

AS for some other possible solutions you coudl try lookign here: (compatible with .Net 1.1)


Gary Francis
Software Developer
*** URL removed by humeniuk PE ***

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.