-
Nov 20th, 2016, 02:50 PM
#1
Thread Starter
Hyperactive Member
Authentication is required for relay - mail error
Hello
I am getting the following online error:
Mailbox unavailable. The server response was: Authentication is required for relay
I am using valid SMTP credentials provided by my Web hosting service, so I am unsure what extra authentication is required. Should the server people at my Web hosting service be providing that 'relay authentication'?
Thank you
Steve
-
Nov 20th, 2016, 08:22 PM
#2
Re: Authentication is required for relay - mail error
Is the From address on a different domain?
-
Nov 20th, 2016, 11:17 PM
#3
Thread Starter
Hyperactive Member
Re: Authentication is required for relay - mail error
No. The From address is from the domain that is hosted by my Web hosting service.
-
Nov 20th, 2016, 11:33 PM
#4
Re: Authentication is required for relay - mail error
Perhaps you should show us the code you're using.
-
Nov 20th, 2016, 11:34 PM
#5
Re: Authentication is required for relay - mail error
-
Nov 20th, 2016, 11:41 PM
#6
Thread Starter
Hyperactive Member
Re: Authentication is required for relay - mail error
Thanks jmcilhinney
Here it is.
Code:
Dim myMessage As New MailMessage
Dim Smtpserver As New SmtpClient
Dim strEmailValue As String = Request.Form("strEmailTextBox")
'create the mail message
myMessage.From = New MailAddress("info@myDomain.net") 'Webmaster's email
myMessage.To.Add(New MailAddress("info@myDomain.net")) 'Webmaster's email
myMessage.ReplyToList.Add(strEmailValue) 'user's email
myMessage.Subject = ("Password Reset Request")
myMessage.Body = "Please click on the following link to reset you password: <br/>Link<br/><br/>Thank you<br/>"
myMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure
myMessage.IsBodyHtml = True
myMessage.Priority = MailPriority.High
Smtpserver.DeliveryMethod = SmtpDeliveryMethod.Network
Smtpserver.Host = ("mail.server") 'Exact server name provided by Web hosting service
Smtpserver.Port = 25
Smtpserver.EnableSsl = False
Dim basicAuthenticationInfo As New System.Net.NetworkCredential("info@myDomain.net", "SMTP_password_from_Hosting_Service")
Smtpserver.Credentials = basicAuthenticationInfo
Smtpserver.UseDefaultCredentials = False
Smtpserver.Send(myMessage)
myMessage.Dispose()
myMessage = Nothing
Smtpserver = Nothing
'Text to tell user pwd reset link has been sent
strEmailValue = Request.QueryString("strEmailValue")
If strEmailValue IsNot Nothing Then
TextBox1.Text = String.Format("Your password reset link has been sent to {0}", strEmailValue)
TextBox1.Visible = True
Else
TextBox1.Visible = False
End If
End If
End Sub
I will visit the link now. Thanks again.
-
Nov 20th, 2016, 11:46 PM
#7
Thread Starter
Hyperactive Member
Re: Authentication is required for relay - mail error
Yes, it's easy to forget that 'true' in Web.config - http://stackoverflow.com/questions/2...ired-for-relay
I have it set to 'true' when I have Visual Studio open, but change it to false when compiling and uploading the pages.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|