I have this powershell script to sending emails with attachments, but when I add multiple recipients, only the first one gets the message. I\'ve read the documentation and s
You must first convert the string to a string array, like this:
$recipients = "Marcel ,Marcelt "
[string[]]$To = $recipients.Split(',')
Then use Send-MailMessage like this:
Send-MailMessage -From "primasfrb@nbs.sk" -To $To -subject "New files" -body "$teloadmin" -BodyAsHtml -priority High -dno onSuccess, onFailure -smtpServer 192.168.170.61