Hi,
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: https://github.com/AmanDhally/OutlookTools
Let’s start
- First download the “OutlooTools.Psm1” and .psd1 file fromhttps://github.com/AmanDhally/OutlookTools
- Create a folder Name “OutlookTools” in “Libraries\Documents\WindowsPowershell\Modules”
- and paste both files there.
Now open Powershell console and run the cmdlet,
Import-Module OutlookTools |
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 amandhally@gmail.com with subject “Sending from Powershell” and with body text “Heya its working”
New-OutlookEmail -To amandhally@gmail.com -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 "amandhally@gmail.com" -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: https://github.com/AmanDhally/OutlookTools
i hope you will like it.
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.
ReplyDelete