I have a web (IIS) application that relays via our exchange computer. Both computers are on the local network. The IIS server is listed as an enabled relay on the exchange server. There is no auth required from the IIS server IPs.
Mail sent to the local domain works fine. Mail sent to an external address fails. All mail sent to external addresses using their mail client (Outlook, mobile devices, etc,) is working fine. The issue is limited to the relay from IIS to external email accounts.
The error received is below:
Mailbox unavailable. The server response was: 5.7.1 Unable to relay for %firstname.lastname@example.org
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for %Usernameemail@example.com
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay for %Usernamefirstname.lastname@example.org]
NFHS.CoachAwards.Recover.SubmitButton_Click(Object sender, EventArgs e) +898
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981