Pragmatic.Email
1.0.0-alpha.6
dotnet add package Pragmatic.Email --version 1.0.0-alpha.6
NuGet\Install-Package Pragmatic.Email -Version 1.0.0-alpha.6
<PackageReference Include="Pragmatic.Email" Version="1.0.0-alpha.6" />
<PackageVersion Include="Pragmatic.Email" Version="1.0.0-alpha.6" />
<PackageReference Include="Pragmatic.Email" />
paket add Pragmatic.Email --version 1.0.0-alpha.6
#r "nuget: Pragmatic.Email, 1.0.0-alpha.6"
#:package Pragmatic.Email@1.0.0-alpha.6
#addin nuget:?package=Pragmatic.Email&version=1.0.0-alpha.6&prerelease
#tool nuget:?package=Pragmatic.Email&version=1.0.0-alpha.6&prerelease
Pragmatic.Email
Email for .NET without a third-party mail library: SMTP with connection pooling, DKIM / S/MIME signing, a middleware pipeline, and first-class testing support.
The Problem
Sending email in .NET usually means pulling in MailKit (200K+ lines, dozens of transitive dependencies) for what should be straightforward, and you still hand-wire the message, with no connection pooling and no pipeline.
// Typical MailKit setup: new TCP connection every time, no pipeline
using var client = new SmtpClient();
await client.ConnectAsync("smtp.hotel.com", 587, SecureSocketOptions.StartTls);
await client.AuthenticateAsync("user", "pass");
await client.SendAsync(message);
await client.DisconnectAsync(true);
The Solution
A small email library (it depends only on Microsoft.Extensions.* abstractions and
System.Security.Cryptography.Pkcs) with a fluent message API, pooled SMTP connections, optional
DKIM/S-MIME signing, a middleware pipeline and in-memory/file transports for tests. The shipped
middleware are DefaultFromMiddleware, DkimMiddleware and SmimeMiddleware; add your own with
EmailBuilder.AddMiddleware<T>().
var message = new EmailMessageBuilder()
.From("booking@hotel.com", "Hotel Booking")
.To(guest.Email)
.Subject("Reservation Confirmed")
.HtmlBody("<h1>Confirmed</h1>...")
.TextBody("Confirmed ...")
.Attach("invoice.pdf", pdfBytes, "application/pdf")
.Build();
EmailResult sent = await emailSender.SendAsync(message); // IEmailSender
This module sends; it does not write the body. A mail a person reads comes from a .pdxemail
template resolved against data (Pragmatic.Email.Templates, Pragmatic.Email.Model and
Pragmatic.Documents.Email, all part of Pragmatic.Documents)
and its HTML and text go into HtmlBody / TextBody here. See
HTML email rendering.
Connections are pooled across sends; configure the transport once in the host. The builder validates addresses as you add them, so a malformed one fails where you wrote it rather than at send time.
Installation
dotnet add package Pragmatic.Email
dotnet add package Pragmatic.Email.Testing # InMemoryTransport, FileTransport: test projects only
Status
Functional within 1.0.0-alpha: SMTP transport, pooling, DKIM and S/MIME signing, the middleware pipeline, and test support. See the roadmap.
TLS is negotiated with STARTTLS by default and switches to implicit TLS (SMTPS) automatically on port
465; set UseImplicitTls to force either mode. TimeoutSeconds bounds connect, reads and writes.
Known limit: bodies are sent as 8bit; quoted-printable is not implemented.
Documentation
| Guide | What you'll learn |
|---|---|
| Concepts | Message model, transport, pooling, the middleware pipeline |
| Getting Started | Send your first email, configure SMTP, test it |
| Common Mistakes | The most frequent email pitfalls |
| Troubleshooting | Problem/solution guide |
Requirements
- .NET 10.0+
License
Part of the Pragmatic.Design ecosystem. See Licensing. Pragmatic.Email is licensed under the PolyForm Small Business 1.0.0 license (free for small businesses; commercial license above the threshold).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net11.0 is compatible. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.10)
- Microsoft.Extensions.Options (>= 10.0.10)
- Pragmatic.Abstractions (>= 1.0.0-alpha.6)
- Pragmatic.Ensure (>= 1.0.0-alpha.6)
- System.Security.Cryptography.Pkcs (>= 9.0.21)
-
net11.0
- Pragmatic.Abstractions (>= 1.0.0-alpha.6)
- Pragmatic.Ensure (>= 1.0.0-alpha.6)
- System.Security.Cryptography.Pkcs (>= 9.0.21)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Pragmatic.Email:
| Package | Downloads |
|---|---|
|
Pragmatic.Notifications
Unified notification system for Pragmatic.Design. Pipeline-based delivery across email, webhook, push, SMS channels with audience routing, preferences, and tracking. |
|
|
Pragmatic.Email.Testing
Test harness for Pragmatic.Email: InMemoryTransport, FileTransport, and assertion helpers for email testing. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-alpha.6 | 166 | 11/21/2026 |
| 1.0.0-alpha.5 | 97 | 11/21/2026 |
| 1.0.0-alpha.4 | 164 | 11/16/2026 |
| 1.0.0-alpha.3 | 449 | 10/17/2026 |
| 1.0.0-alpha.2 | 158 | 10/12/2026 |
| 1.0.0-alpha.1 | 370 | 10/3/2026 |