Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting Outlook and having an email pre-populated from command line [closed]

Tags:

Is this possible? I want to have the To:, Body, and an Attachment all pre-populated so all the user has to do is click send. Thanks!

like image 912
skb Avatar asked Oct 29 '08 21:10

skb


People also ask

Why are my Outlook contacts not auto populating?

Click File, and then click Options. Select the Mail tab. Scroll approximately halfway down until you see Send messages. Make sure that the Use Auto-Complete List to suggest names when typing in the To, Cc, and Bcc lines box is checked.

How do I stop Outlook from command line?

If you choose to kill the Outlook task, here you have two options: About the cmd commands... you have two, one for search (tasklist) and other for kill (taskkill). If only want to "delete" the process, just use: "taskkill /IM "OUTLOOK. EXE"".


1 Answers

Open a new mail message (ipm.note is the message class for emails)

outlook.exe /c ipm.note 

Open a new mail message and populate sender:

outlook.exe /c ipm.note /m [email protected] 

Open a new mail message with attachment:

 outlook.exe /c ipm.note /a filename 

Combination: (First one below didn't work in Office 2016, second did)

 outlook.exe /c ipm.note /m [email protected]&subject=test%20subject&body=test%20body  outlook.exe /c ipm.note /m "[email protected]&subject=test%20subject&body=test%20body" 

The %20 has to be used to produce a blank space.

  • More details at Command Line for Creating a Pre-Addressed E-mail Message
  • Command-line switches can be found here

This works for instance with a classic Outlook 2016 (build 16.0.4849.1000).

But, as Snozzlebert notes in the comments, for a Outlook 365 Version 2001 (Build 12430.20184) the syntax would be:

outlook.exe /c ipm.note /m "[email protected]?subject=test" 

the culprit was the & after the email-address - replacing it with ? solved the problem.
It seems that Microsoft changed the syntax to the HTML mailto syntax.

like image 172
VonC Avatar answered Sep 25 '22 09:09

VonC