net8.0net9.0
An Aspire component leveraging the MailPit container.
Published
Feb 26, 2025
1y ago
Total Downloads
408.1K
408,091
Install
dotnet add package CommunityToolkit.Aspire.Hosting.MailPit --version 9.2.0-beta.201
| Product | Versions |
|---|---|
| .NET |
README
CommunityToolkit.Hosting.MailPit
Overview
This .NET 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
No structural changes between v9.2.0-beta.199 and v9.2.0-beta.201.
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 2 target frameworks; confirm the exact target used by your application.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.