Mailozaurr - PowerShell Module
Mailozaurr is a PowerShell module that aims to provide SMTP, POP3, IMAP and few other ways to interact with Email. Underneath it uses MimeKit and MailKit and EmailValidation libraries written by Jeffrey Stedfast.
For oAuth2 it also requires some Microsoft and Google libraries that are also bundled in
Finally since Resolve-DNSName
is Windows specific I'm using:
This started with a single goal to replace Send-MailMessage
which is depracated/obsolete with something more modern, but since MailKit and MimeKit have lots of options why not build on that?
Features
- Send Email (
Send-EmailMessage
) using:- SMTP with standard password
- SMTP with oAuth2 Office 365
- SMTP with oAuth2 Google Mail
- SMTP with SendGrid
- SendGrid API
- Office 365 Graph API
- POP3
- Connect to POP3
- Get POP3 Emails
- Save POP3 Emails
- IMAP
- Connect to IMAP
- Get IMAP Folder
- Get Messages (you have to your own work to get what you need). Needs improvements!
- Office 365 Graph API
- Get Mail Folders
- Get Mail Messages
- Save Mail Messages
- DNS Checks via TCP/UDP, but also via HTTPS using Cloudflare/Google providers
- DKIM Reporting (
Find-DKIMRecord
) - MX Reporting (
Find-MXRecord
) - DMARC Reporting (
Find-DMARCRecord
) - SPF Reporting (
Find-SPFRecord
) - DNSBL Reporting (
Find-DNSBL
)
- DKIM Reporting (
- Email Validation
- Test Email Address for errors
Documentation
While I didn't spent much time creating WIKI, working on Get-Help documentation, I did write blog articles that should help you get started.
- Mailozaurr – New mail toolkit (SMTP, IMAP, POP3) with support for oAuth 2.0 and GraphApi for PowerShell
- Easy way to send emails using Microsoft Graph API (Office 365) with PowerShell
You can also utilize Examples which should help to understand use cases. Of course it would be great having pretty help so if you can help me out feel free to submit PR's.
Keep in mind PSSharedGoods is only required for development. When you use this module from PowerShellGallery it's not installed as everything is merged.
To install
Install-Module -Name Mailozaurr -AllowClobber -Force
Force and AllowClobber aren't necessary, but they do skip errors in case some appear.
And to update
Update-Module -Name Mailozaurr
That's it. Whenever there's a new version, you run the command, and you can enjoy it. Remember that you may need to close, reopen PowerShell session if you have already used module before updating it.
The essential thing is if something works for you on production, keep using it till you test the new version on a test computer. I do changes that may not be big, but big enough that auto-update may break your code. For example, a small rename to a parameter, and your code stops working! Be responsible!