· 9 years ago · Feb 02, 2017, 09:54 PM
1function sendMail($AlertType, $body) {
2 #SMTP server name
3 $From = "@gmail.com"
4 $To = "@.com"
5 $Cc = "@.com"
6 $Subject = ""Dell OMSA $AlertType Alert on $env:COMPUTERNAME""
7 $Body = "$body"
8 $SMTPServer = "smtp.gmail.com"
9 $SMTPPort = "587"
10
11
12 #Sending email
13 Send-MailMessage -From $From -to $To -Cc $Cc -Subject $Subject `
14 -Body $Body -SmtpServer $SMTPServer -port $SMTPPort -UseSsl `
15 -Credential (Get-Credential)
16
17}