Powershell – Unable to forward messages from outlook to gmail

exchangeexchangeonlineoutlookpowershell

https://docs.microsoft.com/en-us/exchange/recipients/user-mailboxes/email-forwarding?view=exchserver-2019

I referred the above tutorial to setup email forwarding in exchange. It was working fine when I configured email forwarding from EAC. But it was to another user in the same domain.

But when I tried to forward the mails to a gmail account using powershell, even though the code executed successfully mails are not forwarded to the target gmail account and whenever i send mails to the configured outlook mail I receive the following error : "Delivery has failed to these recipients or groups:". But the mail gets delivered.

The powershell code i used is this :

Set-Mailbox -Identity "cliff" -DeliverToMailboxAndForward $true -ForwardingSMTPAddress "<recipient>@gmail.com"

Best Answer

What happens if you send emails directly to the gmail mailbox? Are there any filters which were created to block emails in the "Filters and Blocked Addresses" gmail setting.