Powershell send-mailmessage - email to multiple recipients

前端 未结 7 2094
小蘑菇
小蘑菇 2020-11-29 07:10

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

7条回答
  •  甜味超标
    2020-11-29 07:31

    Just creating a Powershell array will do the trick

    $recipients = @("Marcel ", "Marcelt ")
    

    The same approach can be used for attachments

    $attachments = @("$PSScriptRoot\image003.png", "$PSScriptRoot\image004.jpg")
    

提交回复
热议问题