Guest User

Untitled

a guest
Jan 30th, 2018
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. $DownloadReportResponse = Invoke-WebRequest -Method Post -Uri $DownloadReportUrl -ContentType "application/json" -Headers $headers -Body $DownloadReportRequestBody -OutFile "C:NeoloadTestResult-($DateForTestResult).pdf" -TransferEncoding "deflate"
  2.  
  3. ###########Define Variables########
  4.  
  5. $fromaddress = "myGmail@gmail.com"
  6. $toaddress = "myGmail@gmail.com"
  7. #$CCaddress = "myGmail@gmail.com"
  8. $Subject = "ACtion Required"
  9. $body = get-content .content.htm
  10. $attachment = $DownloadReportResponse
  11. $smtpserver = "smtp.labtest.com"
  12.  
  13. ####################################
  14.  
  15. $message = new-object System.Net.Mail.MailMessage
  16. $message.From = $fromaddress
  17. $message.To.Add($toaddress)
  18. $message.CC.Add($CCaddress)
  19. $message.Bcc.Add($bccaddress)
  20. $message.IsBodyHtml = $True
  21. $message.Subject = $Subject
  22. $attach = new-object Net.Mail.Attachment($attachment)
  23. $message.Attachments.Add($attach)
  24. $message.body = $body
  25. $smtp = new-object Net.Mail.SmtpClient($smtpserver)
  26. $smtp.Send($message)
Add Comment
Please, Sign In to add comment