Project

Mailozaurr

Mailozaurr is a PowerShell module that aims to provide SMTP, POP3, IMAP and probably some other ways to interact with Email. Underneath it uses MimeKit and MailKit libraries written by Jeffrey Stedfast.

Stars219
Forks17
Open issues0
PowerShell Gallery downloads1226648
ReleaseMailozaurr-v20260306122612
Language: C# Updated: 2026-04-18T22:08:00.0000000+00:00

Curated Examples

Test SMTP before sending

Use Mailozaurr to test SMTP capabilities and choose a safer send pattern.

This pattern is useful before adding SMTP sending to an operational script.

It comes from the source example at Examples/Example-TestSmtpConnection.ps1.

When to use this pattern

  • You need to confirm SMTP connectivity before sending mail.
  • You want to decide whether connection pooling is safe.
  • You are adding a WhatIf-protected send path to a script.

Example

Import-Module .\Mailozaurr.psd1 -Force

$info = Test-SmtpConnection -Server 'smtp.example.com' -Port 587

$poolSettings = if ($info.Persistent) {
    @{ UseConnectionPool = $true; ConnectionPoolSize = 2 }
} else {
    @{}
}

Send-EmailMessage -From '[email protected]' -To '[email protected]' -Server 'smtp.example.com' @poolSettings -WhatIf

What this demonstrates

  • testing the transport before sending
  • using SMTP capability data to shape the send path
  • keeping the example safe with WhatIf

Source