AspNetMailbox 0.1.0

dotnet add package AspNetMailbox --version 0.1.0
                    
NuGet\Install-Package AspNetMailbox -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AspNetMailbox" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AspNetMailbox" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="AspNetMailbox" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AspNetMailbox --version 0.1.0
                    
#r "nuget: AspNetMailbox, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AspNetMailbox@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AspNetMailbox&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=AspNetMailbox&version=0.1.0
                    
Install as a Cake Tool

AspNetMailbox

NuGet License: MIT

Captures outbound email in-process during development and previews it at /_mailbox. No separate mail server, no Docker. Part of the AspNetDebugDashboard suite.

Mailbox

Install

dotnet add package AspNetMailbox

Setup

using AspNetMailbox;

builder.Services.AddMailbox();   // 1. register + start the SMTP sink
var app = builder.Build();
app.UseMailbox();                // 2. serve /_mailbox (no-op outside Development)

Point your existing email code at the sink in Development and open /_mailbox.

Capturing mail

SMTP sink (default). A tiny in-process SMTP server listens on port 2525. Send to localhost:2525 from any library (MailKit, System.Net.Mail, anything) and it's captured. This is the Mailpit/smtp4dev model without the separate process.

using var smtp = new SmtpClient("localhost", 2525);
smtp.Send(message);

Explicit. For senders that don't use SMTP, hand messages over directly:

public class Notifier(IMailbox mailbox)
{
    public void Send(MimeMessage message) => mailbox.Capture(message);
}

What you get

/_mailbox lists captured mail. Open one for tabs: rendered Preview (sandboxed, captured HTML can't run scripts in your dashboard) with a light/dark background toggle, HTML, Text, Headers, Raw source, and Attachments (downloadable). Search by subject or sender, or download the whole message as a .eml file.

Configuration

builder.Services.AddMailbox(o =>
{
    o.BasePath = "/_mailbox";       // dashboard route
    o.SmtpPort = 2525;              // sink port
    o.EnableSmtpSink = true;        // turn the sink off if you only capture explicitly
    o.MaxMessages = 200;            // oldest trimmed past this
    o.DatabasePath = "mailbox.db";  // local LiteDB store
});

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 49 6/17/2026