Hi there,
How could I invoke powershell to:
- Send a file or an attachment
- Send a content to multiple recipient
- Be invoked by a batch file to execute the param clause
Help will be appreciate.
param(
[string]$highs, [string]$mediums, [string]$lows
)
$EmailFrom = �name@domain.com�
$EmailTo = �xxxxx@XXX.com�
$Subject = �New Scan is done!�
$Body = "High=$highs, Mediums=$mediums, Lows=$lows"
$SMTPServer = �smtp.gmail.com�
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("Google-UserName", �Google-Password�);
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)