Advertisement
Guest User

Untitled

a guest
Mar 10th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. $From = "email"
  2. $To = "emails"
  3. $SMTPServer = "smtp"
  4. $SMTPPort = "587"
  5. $Username = "email"
  6. $Password = "password"
  7. $Body =$body
  8. $Subject = "$computer$ status"
  9. $smtp = New-Object System.Net.Mail.SmtpClient($SMTPServer, $SMTPPort);
  10. $smtp.EnableSSL = $false
  11. $smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);
  12. $smtp.Send($From, $To, $subject, $body);
  13. $computer = $env:computername
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement