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
To define an array of strings it is more comfortable to use $var = @('User1 ', 'User2 ').
$servername = hostname
$smtpserver = 'localhost'
$emailTo = @('username1 ', 'username2')
$emailFrom = 'SomeServer '
Send-MailMessage -To $emailTo -Subject 'Low available memory' -Body 'Warning' -SmtpServer $smtpserver -From $emailFrom