AxisEmail 2.2.0
dotnet add package AxisEmail --version 2.2.0
NuGet\Install-Package AxisEmail -Version 2.2.0
<PackageReference Include="AxisEmail" Version="2.2.0" />
<PackageVersion Include="AxisEmail" Version="2.2.0" />
<PackageReference Include="AxisEmail" />
paket add AxisEmail --version 2.2.0
#r "nuget: AxisEmail, 2.2.0"
#:package AxisEmail@2.2.0
#addin nuget:?package=AxisEmail&version=2.2.0
#tool nuget:?package=AxisEmail&version=2.2.0
AxisEmail — Documentation
A one-method email port — IAxisEmailService.SendAsync(AxisEmailData) returning an AxisResult. The bundled AxisEmail.MimeKit adapter handles SMTP (gmail, SES, Mailtrap, anywhere with credentials and a port). The application code never sees MimeMessage or SmtpClient.
public Task<AxisResult> NotifyOrderShippedAsync(Order order)
=> email.SendAsync(new AxisEmailData
{
To = [(order.Customer.Name, order.Customer.Email)],
Subject = $"Your order {order.OrderId} has shipped",
Body = $"Hi {order.Customer.Name}, your order is on its way.",
});
Use this page as a map: read the trunk below (~5 min) and jump straight to the detail of the group you need — without reading hundreds of lines.
The trunk (read first)
The interface in 60 seconds
public interface IAxisEmailService
{
Task<AxisResult> SendAsync(AxisEmailData data);
}
One method. The payload (AxisEmailData) carries recipients (To + Cc), subject, body and the body's MIME subtype (plain or html). Sender, SMTP host and credentials live in AxisEmailSettings, bound from configuration. → The IAxisEmailService contract
The payload — AxisEmailData
public record AxisEmailData
{
public required IEnumerable<(string Name, string Email)> To { get; init; }
public required string Subject { get; init; }
public required string Body { get; init; }
public string BodyTextType { get; init; } = "plain"; // or "html"
public IEnumerable<(string Name, string Email)> Cc { get; init; } = [];
}
→ Email payload · AxisEmailData
Bundled adapter — MimeKit
AxisEmail.MimeKit is the MailKit / MimeKit implementation. SMTP host, port, SSL, sender and password come from configuration. → AxisEmail.MimeKit adapter
services.AddAxisMimeKitEmail(builder.Configuration);
Installation
dotnet add package AxisEmail # the abstraction
dotnet add package AxisEmail.MimeKit # the MimeKit/MailKit adapter
→ Full guide: Getting started
The map (jump to what you need)
| Group | You want to… | Detail |
|---|---|---|
Contract · IAxisEmailService ⭐ |
send one email | iaxisemailservice.md |
Payload · AxisEmailData |
the shape of an email | axis-email-data.md |
Settings · AxisEmailSettings |
configure SMTP and sender | settings.md |
MimeKit · AxisEmail.MimeKit |
the bundled MailKit adapter | mimekit-adapter.md |
| Custom adapter | write your own (SendGrid, SES, Mailgun) | custom-adapter.md |
| Why? | the case against SmtpClient directly |
why-axisemail.md |
| Reference | every member at a glance | api-reference.md |
Start here: Getting started · The IAxisEmailService contract · Why AxisEmail?
Fundamentals: Email payload · Settings · AxisEmail.MimeKit adapter
Reference & extras: Custom adapter · API reference
Design principles
- One method, one payload. Everything an email needs lives in
AxisEmailData. Adapters never invent extra parameters. - Credentials live in
AxisEmailSettings. Application code never sees the password. Configuration binds the secrets once. - Errors are values. SMTP failures, auth errors, timeouts — all collapse into a single
AxisError.InternalServerError("ERROR_SENDING_EMAIL")so callers handle them like any other rail failure. - The adapter is replaceable. Drop in
AddSendGridEmail()and the application is none the wiser. - HTML or plain.
BodyTextTypepicks the MIME subtype —plainby default,htmlfor templated mails.
License
Apache 2.0
| 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. |
-
net10.0
- AxisResult (>= 2.2.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on AxisEmail:
| Package | Downloads |
|---|---|
|
AxisEmail.MimeKit
Part of the Axis Framework — an opinionated, ports-and-adapters .NET framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.