How to Send Outlook 2007 Email from the Command Line & Example to Create a Shortcut

How to Send Outlook 2007 Email from the Command Line & Example to Create a Shortcut
Page content

Using the Command Line to Creating Emails, Appointments, and Tasks in Outlook

There are numerous Outlook 2007 command line switches that can be executed from the Run line or a command prompt. One of these switches creates a new e-mail message.

The Outlook 2007 executable is outlook.exe. It is found in %programfiles%\Microsoft Office\Office12\. You can call outlook.exe from the command line with the full path (or add the location to the Path environment variable). The command line switch for creating a new object is /c. You can then identify the type of object, or the messageclass, to create with a different parameter for each Outlook form. For example:

  • ipm.activity creates a Journal entry
  • ipm.appointment creates an appointment
  • creates a contact
  • ipm.note creates an e-mail message
  • ipm.stickynote creates a note
  • ipm.task creates a task

Example Command to Send Email with Attachment

When using the command line parameter /c you can also assign a recipient address to the new e-mail form using the /m switch. If you needed to add an attachment, that can also be accomplished with a command line request. The /a switch with the file path will attach the specified file to the new e-mail form. So, as an example, to create a new e-mail form addressed to [email protected] with an attachment logfile.txt, you would run from the command line:

c:\>“c:\program files\microsoft office\office12\outlook.exe” /c ipm.note /m [email protected] /a “c:\logs\logfile.txt”

This is shown in the image to the left. The image on the right shows the output for this command. The path to outlook.exe is in quotes because there are spaces in the path.

Outlook Email With Attachment Opened from the Command Line

You can create a desktop shortcut to launch this email message as well. Right click on the desktop and select New Shortcut and enter the same path used from the command line. Now double-clicking the shortcut will create the new message. I have used this basic process for a recurring message that manually sent a text file to a recipient. The user did not have to create and address the message every time.

There are other methods of creating new emails without using the Outlook user interface. To expand on this tip, check out Microsoft KB article 287573.

This post is part of the series: Microsoft Office Outlook 2007 Tips

A series of Tips and Tricks for working with Microsoft Outlook 2007 both as a user and an administrator.

  1. New E-mail Account Configuration in Microsoft Outlook: Tip #1
  2. Use AutoComplete “Nickname” Cache in Outlook: Tip #2
  3. Configure Outlook Custom Message Views: Tip #3
  4. How to Configure RSS Feeds in Outlook: Tip #4
  5. Tip #5 - Making Changes to the Custom Dictionary in Microsoft Outlook 2007
  6. Tip #6 - Configure Outlook Autosave Settings
  7. Microsoft Outlook Keyboard Shortcuts: Tip #7
  8. Microsoft Outlook 2007 Tip #8 - Outlook.exe Startup Switches
  9. Microsoft Outlook Instant Messenger Addons: #9
  10. Tip #10 - Using Outlook 2007 to Access GMail
  11. Showing Full Message Headers in Microsoft Outlook 2007: Tip #11
  12. How to Re-Send an E-mail Message in Outlook: Tip #12
  13. How to View Animated GIFs Embedded in an E-mail in Microsoft Outlook 2007: Tip #13
  14. Telling Outlook How to Handle Messages: Tip #14
  15. Microsoft Outlook 2007 Tip #15 - How to Color Code the Task List in the To Do Bar
  16. Tip #16 - Importing from Incredimail to Microsoft Outlook 2007
  17. Viewing Multiple Outlook Calendars: Tip #17
  18. Removing Cancelled Future Appointments in Microsoft Outlook 2007: Tip #18
  19. Tip #19: How to Create New Outlook E-mail from the Command Line
  20. How to Configure Outlook AutoArchiving: Tip #20
  21. Using Custom Categories in Microsoft Outlook 2007: Tip #21
  22. How to Manage Outlook Add-ins: Tip #21
  23. Microsoft Outlook 2007 Tip #23 - Attachment Previewing Options