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

    Question

  • 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("webmail.company.com") 
    client.DeliveryMethod = SmtpDeliveryMethod.Network
    client.UseDefaultCredentials = False
    client.Credentials = New NetworkCredential("Service", "pwd", "company")
    Dim message As MailMessage = New MailMessage("service@company.com", "someone@outsidecompany.com")
    Message.Body = "Test Message"
    Message.Subject = "Hello"
    client.Send(message)
    message = Nothing


    Lukasz

    Wednesday, December 11, 2013 2:35 AM

Answers

All replies