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
        obUser.GetUser(SqlTypes.SqlGuid.Parse(userid))
        Dim obMail As New Web.Mail.MailMessage
        obMail.To = obUser.Email
        obMail.From = "postmaster@sss.net "
        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='http://www.elbalazo.net'>sss.net</a> to login and " & _
            "access your account.<br><br>"
        SmtpMail.SmtpServer = "mail." & System.Configuration.ConfigurationSettings.AppSettings("DomainNameDisplay")
        SmtpMail.Send(obMail)
        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.
LVL 1
dba123Asked:
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.

GaryFrancisLondCommented:
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:
  <system.net>
    <mailSettings>
      <smtp>
        <network host="mySMtpServer" port="25" userName="myUserName" password="myPassword" />
      </smtp>
    </mailSettings>
  </system.net>

Obviosuly you need to replace the "my" settings with your own settings. There is an article/documentation available on this here:
http://msdn2.microsoft.com/en-us/library/w355a94k.aspx or http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx.

AS for some other possible solutions you coudl try lookign here:
http://systemwebmail.com/faq/3.8.aspx (compatible with .Net 1.1)

Regards,

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
ASP.NET

From novice to tech pro — start learning today.