Post

Outlook new email

The below code allows you to open a new email message via outlook on your local PC.

1
2
3
4
5
6
7
8
9
10
11
$ol = New-Object -comObject Outlook.Application
#Create the new email
$mail = $ol.CreateItem(0)
#Optional, set the subject
$mail.Subject = "<subject>"
#Optional, set the body
$mail.Body = "<body>"
#Get the new email object
$inspector = $mail.GetInspector
#Bring the message window to the front
$inspector.Activate()
This post is licensed under CC BY 4.0 by the author.