BobBarker_99
asked on
Mailbox unavailable. The server response was: 5.7.1 Unable to relay
I'm getting the above error message. My code is posted below. The code below has worked fine for several months.
This last week, I started getting the error message stated in the title of the question.
The mailserver and the website are hosted on 2 different servers.
Anyone know why this has stopped working? How I can fix it?
Thanks
This last week, I started getting the error message stated in the title of the question.
The mailserver and the website are hosted on 2 different servers.
Anyone know why this has stopped working? How I can fix it?
Thanks
Dim mail As New MailMessage
Dim fromAddress As New MailAddress("me@mydomain.com")
mail.From = fromAddress
mail.To.Add("towherever@gmail.com")
mail.Subject = "blah"
mail.Body = "123, abc"
Dim mailClient As String = "myMailServer.com"
Dim smtp As New SmtpClient(mailClient)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I had tech services setup the recieve connector, and had them add the servers IP address.
My code is the same, except that I now also use authentication.
Dim myCred As new NetworkCredential("myLogin ", "myPass")
smtp.Credentials = myCred
smtp.Send
I now get the following exception:
Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender
My code is the same, except that I now also use authentication.
Dim myCred As new NetworkCredential("myLogin
smtp.Credentials = myCred
smtp.Send
I now get the following exception:
Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
smtp.Send(mail)