powershell: sending e-mail with attachments (using a pipe)
$PSEmailServer = "mailsrv"
Get-ChildItem("c:\temp") |
ForEach {$_.fullname} |
Send-MailMessage -to "x@regele.org" -from "y@regele.org" -subject "hi" -encoding ([System.Text.Encoding]::UTF8)
$PSEMailServer needs to contain the smtp ServerForEach ... $_.fullname is required if files are not in current path
Get-ChildItem("c:\temp") |
ForEach {$_.fullname} |
Send-MailMessage -to "x@regele.org" -from "y@regele.org" -subject "hi" -encoding ([System.Text.Encoding]::UTF8)
$PSEMailServer needs to contain the smtp ServerForEach ... $_.fullname is required if files are not in current path