“5.7.1 unable to relay” when sending from local Exchange account


  • I have this program that is trying to send an email to an outside address using an internal Exchange account, and I'm getting the following error:

    "mailbox unavailable. the server response was 5.7.1 unable to relay"

    We have Exchange 2010. I don't understand why, since the account I'm using to send is a local account. Here's my code:

    Dim client As SmtpClient = New SmtpClient("") 
    client.DeliveryMethod = SmtpDeliveryMethod.Network
    client.UseDefaultCredentials = False
    client.Credentials = New NetworkCredential("Service", "pwd", "company")
    Dim message As MailMessage = New MailMessage("", "")
    Message.Body = "Test Message"
    Message.Subject = "Hello"
    message = Nothing


    Wednesday, December 11, 2013 2:35 AM


All replies