CommunityToolkit.Aspire.Hosting.MailPit
v17.0.0-beta.1018Latest Pre-release
net10.0
An Aspire component leveraging the MailPit container.
Published
Nov 6, 2026
today
Total Downloads
562.2K
562,174
Install
dotnet add package CommunityToolkit.Aspire.Hosting.MailPit --version 17.0.0-beta.1018
| Product | Versions |
|---|---|
| .NET |
README
CommunityToolkit.Hosting.MailPit
Overview
This Aspire Integration runs MailPit in a container.
Usage
The MailPit integration exposes a connection string with the format endpoint=smtp://<host>:<port>.
This connection string can be used to with a DbConnectionStringBuilder to get the smtp endpoint.
Example 1: Add MailPit with generated ports
var builder = DistributedApplication.CreateBuilder(args);
var mailpit = builder.AddMailPit("mailpit");
var xyz = builder.AddProject<Xyz>("application")
.WithReference(mailpit)
.WaitFor(mailpit);
builder.Build().Run();
Example 2: Add MailPit with user-defined ports
var builder = DistributedApplication.CreateBuilder(args);
var mailpit = builder.AddMailPit("mailpit", 80, 25);
var xyz = builder.AddProject<Xyz>("application")
.WithReference(mailpit)
.WaitFor(mailpit);
builder.Build().Run();
Changes from Previous Version
v17.0.0-beta.1009v17.0.0-beta.1018
Added Dependencies
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.