# Test SMTP before sending

Test SMTP before sending on Evotec with practical examples, usage guidance, and reusable project workflows.

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.

[View on GitHub](https://github.com/EvotecIT/Mailozaurr) [Visit Website](#) [Releases](https://github.com/EvotecIT/Mailozaurr/releases/tag/Mailozaurr-v3.0.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/Mailozaurr)

Stars**236**

Forks**19**

Open issues**0**

PowerShell Gallery downloads**1287453**

Release**v3.1.1**

Language: C# Updated: 2026-11-23

Curated Examples

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

```powershell
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 'sender@example.com' -To 'recipient@example.com' -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

- [Example-TestSmtpConnection.ps1](https://github.com/EvotecIT/Mailozaurr/blob/v2-speedygonzales/Examples/Example-TestSmtpConnection.ps1)

<!-- PowerForge markdown artifact sha256:F03F23FF46DB78ADE63E4E476A0176E19B6AFBD7948A1AD739242E614F6BDEAC -->
