1
votes

I am trying to send emails from a powershell 2.0 script. Messages send to other recipients on my domain are properly delivered, but external domains cannot receive the messages. I have tried passing the external email address to send-mailmessage as a string, as an array, and explicitly as the only argument for that class of recipient, and the message doesn't go out. I am relaying off an SMTP connector I added to my Exchange 2007 server. Any ideas? I get an error message back that says "Unable to send to a recipient'

Send-Mailmessage <<<< -To $testto -From $Mailfrom -Cc $testcc -Subject "..." -Body "..." -SmtpServer "x.x.x.x" +CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-Mailmessage], SmtpFailedRecipientsException +FullyQualifiedErrorID : SmtpFailedRecipientsException,Microsoft.PowerShell.Commands.SendMailmessage

Is this a resolution error? I am using a gmail account as a test recipient.

1

1 Answers

1
votes

Thanks for the info- I started researching Exchange 2007 and I have gotten relaying to work properly. What you need to do is to edit the properties on the Receive connector that you relay your SMTP messages with. Set the Permission Groups to Exchange servers and Anonymous Users, and set the Authentication to Externally Secured. This enabled the script to send the messages externally as well as internally. As always, remember to follow best practices for security and research topics like this thoroughly before attempting them.