Last active
November 7, 2017 16:04
-
-
Save daurrutia/d1f162070e1e3c3bca9014a7c1c7782c to your computer and use it in GitHub Desktop.
PowerShell: Send Mail Message via Outlook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$outlook = New-Object -comObject Outlook.Application | |
$mail = $outlook.CreateItem(0) | |
$mail.To = "user@gmail.com;user2@company.com" | |
$mail.Cc = "user3@gmail.com;user4@company.com" | |
$mail.Bcc = "user5@gmail.com;user6@company.com" | |
$mail.Subject = "MY SUBJECT" | |
$mail.Body = "Dear Mr. Boss,`n`nHere is the report you requested.`n`nPlease let me know if you have any questions.`n`nSincerely,`nMY NAME`nTITLE`nCONTACT INFO`nCONTACT INFO`nCONTACT INFO" | |
$mail.Attachments.Add("C:\Users\MYPROFILE\Desktop\FILE.PDF") | |
$mail.save() | |
$inspector = $mail.GetInspector | |
$inspector.Display() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment