By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 904 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Authentication is required for relay

P: 56
Hello

I am getting the following error on a forgotten.aspx page:

http://www.dimadayoub.net/forgot.aspx

Mailbox unavailable. The server response was: Authentication is required for relay

This is the code I have:

Expand|Select|Wrap|Line Numbers
  1. myMessage.From = New MailAddress("info@mysite.net")
  2. myMessage.To.Add(New MailAddress(strEmailValue)) 'user's email
  3. myMessage.Subject = ("Password Reset Request")
  4.  
  5. myMessage.Body = ""
  6. myMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
  7. myMessage.IsBodyHtml = True
  8. myMessage.Priority = MailPriority.Normal
  9.  
  10. HTML code to display header in email and link for user to click on to reset password
  11.  
  12. myMessage.AlternateViews.Add(HtmlMessage)
  13.  
  14. Smtpserver.DeliveryMethod = SmtpDeliveryMethod.Network
  15. Smtpserver.Host = ("mail.server")
  16. Smtpserver.Port = 25
  17. Smtpserver.EnableSsl = False
  18. Dim basicAuthenticationInfo As New System.Net.NetworkCredential("info@mysite.net", "pwd")
  19. Smtpserver.Credentials = basicAuthenticationInfo
  20. Smtpserver.Send(myMessage)
  21.  
  22. myMessage.Dispose()
  23. myMessage = Nothing
  24. Smtpserver = Nothing
Is there anything here, please, that looks obviously wrong? I have checked with my Web hosting service, and the SMTP port, password, and host (mail.server) are correct (they work in another part of the site).

Thanks.
Jan 23 '18 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.