Friday, April 11, 2014

Send-MailMessage : Mailbox unavailable. The server response was: 5.7.1 Unable to relay

You may receive the below error message when you try to execute PowerShell script to trigger email

  Send-MailMessage

 Send-MailMessage : Mailbox unavailable. The server response was: 5.7.1 Unable to relay
At C:\Temp\Get-ExchangeEnvironmentReport.ps1:1096 char:2
+     Send-MailMessage -Attachments $HTMLReport -To $MailTo -From $MailFrom -Subject ..

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   + CategoryInfo         : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpFailed   RecipientException
   + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage

To fix it out follow the below solution

Right click on McAfee icon

VirusScan Console 1

Click on Virus Scan Console

VirusScan Console

Double click on Access Protection on VirusScan Console - On Access Protection tab

Access Protection

Go to Anti-Virus Standard Protection - On right hand side, double click on Prevent mass mailing
worms from sending mail

Anti-Virus Access Protection

On process to exclude tab, add PowerShell.exe at the end

Exception Powershell

Click ok

No comments:

Post a Comment

The blog is written to the share the knowledge mainly on Microsoft Exchange Server and other Microsoft product that experienced on day-to-day life.