a guest Mar 17th, 2018 266 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- param([string]$Body = "")
- $From = "email@example.com"
- $To = "firstname.lastname@example.org"
- $Subject = "UPS Event"
- $SMTPServer = "smtp.gmail.com"
- $SMTPPort = "465"
- $Username = "username"
- $Password = "PlainTextPassword"
- $SecPasswd = ConvertTo-SecureString $Password -AsPlainText -Force
- $MyCreds = New-Object System.Management.Automation.PSCredential ($Username, $SecPasswd)
- Send-MailMessage -From $From -to $To -Subject $Subject `
- -Body $Body -SmtpServer $SMTPServer -port $SMTPPort `
- -Credential $MyCreds -UseSsl
RAW Paste Data