Friday, August 30, 2013

Powershell and Outlook : Create and send a new email using Powershell “OutlookTools” Module.



I have added a new functionality in “OutlookTools” module. Now we can compose and send a new emails using “New-OutlookEmail” function.

This function also do support adding attachments to the composed email, but for now we can attach only one single file.

“OutlookTools” Module download link:

Let’s start


  1. First download the “OutlooTools.Psm1” and .psd1 file from
  2. Create a folder Name “OutlookTools” in “Libraries\Documents\WindowsPowershell\Modules
  3. and paste both files there.

12-08-2013 1 
Now open Powershell console and run the cmdlet, 

Import-Module OutlookTools

12-08-2013 2

By running the Get-Command cmdlet, we can see which cmdlet and function this modules had added.

Get-Command -Module outlooktools


You can see now , we have New-OutlookEmail listed in Function.

How to use it?

It’s simple.

Create a new email.

We are creating a new email , to with subject “Sending from Powershell” and with body text “Heya its working”

New-OutlookEmail -To -Subject "Sending from Powershell" -Body "Heya! its working"


and when you hit enter, you encountered this problem. ,

I haven’t solved it yet and i am working on it. :( .


but when you click on “Allow”. this will send an email.

You can see, the email is come to our Sent Items folder.


and i received it on my Gmail id too.


Now create an email with attachment.

Now , we are creating a new email , with attachment, and with High Priority.

New-OutlookEmail -To "" -Subject "Attaching file"  -Attachment 'D:\a.txt' -importance 2


now when you click on send, the above problem comes again with one more confirmation box.,



once you click on Allows on both.

the email will be in Sent Item


and i received it on my Gmail id with attachments too.


“OutlookTools” Module download link:

i hope you will like it.

Aman Dhally
clip_image001 clip_image002 clip_image003 clip_image005clip_image007

1 comment:

  1. This is an issue with anti-virus program or addin pushed in outlook by anti-virus program. in the past had an issue when using VBA. Tested multiple antivirus but for me Microsoft security essentials works good.