Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail = @{
- from = "hoge@hoge-solutions.com";
- to = "hoge@hoge-solutions.com";
- smtp_server = "smtp.gmail.com";
- smtp_port = 587;
- user = "hoge@gmail.com";
- password = "xxxxxxxx";
- }
- $password = ConvertTo-SecureString $mail["password"] -AsPlainText -Force
- $credential = New-Object System.Management.Automation.PSCredential $mail["user"], $password
- Send-MailMessage -To $mail["to"] `
- -From $mail["from"] `
- -SmtpServer $mail["smtp_server"] `
- -Credential $credential `
- -Port $mail["smtp_port"] `
- -Subject "subject" `
- -Body ((Get-process) | out-string) `
- -Encoding UTF8 `
- -UseSsl
Add Comment
Please, Sign In to add comment