PowerShell wrapper of selected Microsoft Outlook functionality.
- Download the latest version of PsOutlook
- Unzip
- Copy the PsOutlook folder to
C:\Users\<account>\Documents\WindowsPowerShell\Modules
- Type
PS> Import-Module PsOutlook -Force
in script's directory or add to$Profile
# send the message without interaction
PS> Send-Mail -To @("recipient@domain0.tld","recipient@domain1.tld") -Subject "the subject" -Body "the message" -Attachments @("path/to/attachment0","path/to/attachmentN")
# show the message
PS> Send-Mail -To @("recipient@domain0.tld","recipient@domain1.tld") -Subject "the subject" -Body "the message" -Attachments @("path/to/attachment0","path/to/attachmentN") -Preview
# alternative syntax
$Message = @{
To=@("recipient@domain0.tld","recipient@domain1.tld")
Subject="the subject"
Body="the message"
Attachments=@("path/to/attachment0","path/to/attachmentN")
Preview=$True
}
PS> Send-Mail @Message
- Craig Buchanan - Author