Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $DownloadReportResponse = Invoke-WebRequest -Method Post -Uri $DownloadReportUrl -ContentType "application/json" -Headers $headers -Body $DownloadReportRequestBody -OutFile "C:NeoloadTestResult-($DateForTestResult).pdf" -TransferEncoding "deflate"
- ###########Define Variables########
- $fromaddress = "myGmail@gmail.com"
- $toaddress = "myGmail@gmail.com"
- #$CCaddress = "myGmail@gmail.com"
- $Subject = "ACtion Required"
- $body = get-content .content.htm
- $attachment = $DownloadReportResponse
- $smtpserver = "smtp.labtest.com"
- ####################################
- $message = new-object System.Net.Mail.MailMessage
- $message.From = $fromaddress
- $message.To.Add($toaddress)
- $message.CC.Add($CCaddress)
- $message.Bcc.Add($bccaddress)
- $message.IsBodyHtml = $True
- $message.Subject = $Subject
- $attach = new-object Net.Mail.Attachment($attachment)
- $message.Attachments.Add($attach)
- $message.body = $body
- $smtp = new-object Net.Mail.SmtpClient($smtpserver)
- $smtp.Send($message)
Add Comment
Please, Sign In to add comment