Looks like your $MultipleRecipients is simple string. You should pass
recipients as [string[]] (string array).
--
WBR, Vadims Podans
MVP: PowerShell
PowerShell blog -
www.sysadmins.lv
"ABK" <ABK@xxxxxx> rakstīja ziņojumā
"news:53DBE428-E78C-4DC3-9488-8BAC5C8075C6@xxxxxx"...
> Hello Everyone,
> Have this line in my PS script:
> Send-MailMessage -Body $Body -Cc cc@xxxxxx -SmtpServer test.com -From
> from@xxxxxx -To $MultipleRecipients -Subject $Subject
> $MultipleRecipients variable contains several e-mail addresses separated
> by
> comma.
> When I run my script only the 1st e-mail recipient from
> $MultipleRecipients
> variable gets the mssage, the other ones are ignored.
> If I execute this from PS command line (replacing variables with values),
> everything works as expected.
>
> Your help is greatly appreciated.
> ABK