jdhackett
asked on
Code to stop Unable to Relay message for email
Hi
I have the code below, which works fine for sending internal email. Works on a PC.
But for external email, I get the message:
Mailbox unavailable. The server response was: 5.71. unable to relay
I've searched online, but the solutions seem to involve making changes on the exchange server. Is there a way I can add settings through code to fix this issue?
I have the code below, which works fine for sending internal email. Works on a PC.
But for external email, I get the message:
Mailbox unavailable. The server response was: 5.71. unable to relay
I've searched online, but the solutions seem to involve making changes on the exchange server. Is there a way I can add settings through code to fix this issue?
Dim smtp As New SmtpClient("mymailservername")
Dim mailClient As New MailMessage()
With mailClient
.From = New MailAddress(TM_FROM)
.To.Add(stAgent_Email)
.Subject = stSubject
.Body = stBody
End With
'send the message
smtp.Send(mailClient)
ASKER
Ok, can you tell me how to change the permissions on the Exchange server so? Its Exchange 2010, I can't find the "SMTP Virtual Server" that the online help refers to.
Here you go:
http://msexchangeteam.com/archive/2006/12/28/432013.aspx
I generally utilise a new connector.
By the way - I realise it's for 2007 but it's valid for 2010 too.
http://msexchangeteam.com/archive/2006/12/28/432013.aspx
I generally utilise a new connector.
By the way - I realise it's for 2007 but it's valid for 2010 too.
ASKER
Followed those instructions, added the IP of my PC, used Option 1. Still getting the same problem though. Any other ideas?
Do you have SMTP installed on the computer itself?
http://ashrafur.wordpress.com/2008/01/17/mailbox-unavailable-the-server-response-was-571-unable-to-relay-sendername/
http://ashrafur.wordpress.com/2008/01/17/mailbox-unavailable-the-server-response-was-571-unable-to-relay-sendername/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Working now! I was still trying to figure it out, when I tried again and it worked. I think there must be a 10 minute delay between setting it up on the mail server and it actually working?
Either way, all good to go now, thank you.
Either way, all good to go now, thank you.
Ah good - I've never noticed a delay quite that long before but good to know you got it running :-)
This is by design to stop viruses, rogue programs etc doing exactly this - using your server as an open relay and spamming.