December 2015
Intermediate to advanced
760 pages
14h 31m
English
In this recipe, we send an e-mail with an attachment.
Before proceeding, identify the following in your environment:
These are the steps required to send an e-mail:
$file = "C:\Temp\processes.csv" $timestamp = Get-Date -format "yyyy-MMM-dd-hhmmtt" #note we are using backticks to put each parameter #in its own line to make code more readable Send-MailMessage ` -SmtpServer "queryworks.local" ` -To "administrator@queryworks.local" ` -From "powershell@sqlbelle.local" ` -Subject "Process Email - $file - $timestamp" ` -Body "Here ya go" ` -Attachments $file ...
Read now
Unlock full access