Tooluck logoTooluck
SKILL.md

mailpit-integration

Agent skill fromAaronontheweb/dotnet-skills

Test email sending locally using Mailpit with .NET Aspire. Captures all outgoing emails without sending them. View rendered HTML, inspect headers, and verify delivery in integration tests.

How to install mailpit-integration

install mailpit-integration
# install the dotnet-skills pack with the skills CLI
npx skills add Aaronontheweb/dotnet-skills

# or add only this skill to Claude Code: copy the folder

skills/aspire-mailpit-integration/

# into

~/.claude/skills/aspire-mailpit-integration/ (all projects)

.claude/skills/aspire-mailpit-integration/ (one project)

skills/aspire-mailpit-integration/SKILL.md

MITFull file
1# Email Testing with Mailpit and .NET Aspire
2
3## When to Use This Skill
4
5Use this skill when:
6- Testing email delivery locally without sending real emails
7- Setting up email infrastructure in .NET Aspire
8- Writing integration tests that verify emails are sent
9- Debugging email rendering and headers
10
11**Related skills:**
12- `aspnetcore/mjml-email-templates` - MJML template authoring
13- `testing/verify-email-snapshots` - Snapshot test rendered HTML
14- `aspire/integration-testing` - General Aspire testing patterns
15
16---
17
18## What is Mailpit?
19
20[Mailpit](https://github.com/axllent/mailpit) is a lightweight email testing tool that:
21- Captures all SMTP traffic without delivering emails
22- Provides a web UI to view captured emails
23- Exposes an API for programmatic access
24- Supports HTML rendering, headers, and attachments
25
26Perfect for development and integration testing.
27
28---
29
30## Aspire AppHost Configuration
31
32Add Mailpit as a container in your AppHost:
33
34```csharp
35// AppHost/Program.cs
36var builder = DistributedApplication.CreateBuilder(args);
37
38// Add Mailpit for email testing
39var mailpit = builder.AddContainer("mailpit", "axllent/mailpit")
40 .WithHttpEndpoint(port: 8025, targetPort: 8025, name: "ui")
41 .WithEndpoint(port: 1025, targetPort: 1025, name: "smtp");
42
43// Reference in your API project
44var api = builder.AddProject<Projects.MyApp_Api>("api")
45 .WithReference(mailpit.GetEndpoint("smtp"))
46 .WithEnvironment("Smtp__Host", mailpit.GetEndpoint("smtp"));
47
48builder.Build().Run();
49```
50…

Excerpt shown under the repository's MIT license.

More skills in dotnet-skills

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates