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

Advertisements

About Raji Subramanian

Nothing great to say about me...Just want to share my knowledge for others that will be useful at any moment of time when they stuck in critical issue....
This entry was posted in Powershell Command and tagged . Bookmark the permalink.

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

  1. Pingback: Fix Database Mail Error Unable To Relay Windows XP, Vista, 7, 8 [Solved]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s