Send-MailMessage – Send Mail with multiple attachments

Powershell – Send┬áMultiple Email Attachments using Send-MailMessage

Pass each attachment location to a variable and add this to the Attachments parameter separated by comma

Example

$Att1="c:\test1.csv"
$Att2="c:\test1.csv"
Send-MailMessage -To abc@tkr.com - From xyz@tkr.com -Subject "Attachments" -Attachments $Att1,$Att2
Advertisements