Naravel.Mail 0.2.0

dotnet add package Naravel.Mail --version 0.2.0
                    
NuGet\Install-Package Naravel.Mail -Version 0.2.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="Naravel.Mail" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Naravel.Mail" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Naravel.Mail" />
                    
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 Naravel.Mail --version 0.2.0
                    
#r "nuget: Naravel.Mail, 0.2.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 Naravel.Mail@0.2.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=Naravel.Mail&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Naravel.Mail&version=0.2.0
                    
Install as a Cake Tool

Naravel.Mail

NuGet Downloads .NET 10 License: MIT

Typed mail contract for Naravel: Mailable classes, named transports (log, array, SMTP via an optional package) and a test fake, built on Naravel.Foundation.

Fact Detail
Install dotnet add package Naravel.Mail
Targets .NET 10
Needs Naravel.Foundation, which NuGet installs with it
Transports log (the default) and array are built in; add Naravel.Mail.Smtp to deliver for real and Naravel.Mail.Queue to send through a queue

What you get

  • A message is a class. A Mailable builds its MailMessage with MailBuilder, and mailer.To(email).SendAsync(new WelcomeMail(name)) sends it.
  • Named transports. Mail:Default picks the one IMailer uses; the default, log, logs the message and delivers nothing.
  • No network dependency in the core. SMTP is the optional Naravel.Mail.Smtp package and queued sending is Naravel.Mail.Queue.
  • Prepared messages too. IMailer.SendAsync(MailMessage) sends an explicit message without a mailable.
  • A test fake. MailFake records the sent and queued messages and offers AssertSent, AssertSentCount and AssertQueued.

Quick start

{ "Mail": { "From": "app@example.com" } }
using Naravel.Mail;

builder.Services.AddNaravelMail(builder.Configuration);   // Mail:Default is "log": the message is logged, nothing is delivered

app.MapPost("/welcome", async (string email, string name, IMailer mailer, CancellationToken ct) =>
{
    await mailer.To(email).SendAsync(new WelcomeMail(name), ct);
    return Results.Accepted();
});

public sealed class WelcomeMail(string name) : Mailable
{
    public override MailMessage Build(MailBuilder mail) =>
        mail.Subject("Welcome").Text($"Hi {name}").Html($"<p>Hi {name}</p>").Build();
}
Package Adds
Naravel.Mail.Smtp Optional SMTP transport for Naravel.Mail, built on MailKit.
Naravel.Mail.Queue Optional Naravel.Mail adapter that delivers mail through Naravel.Queue: QueueAsync stores only the built message data.

Learn more

Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Naravel.Mail:

Package Downloads
Naravel.Mail.Smtp

Optional SMTP transport for Naravel.Mail, built on MailKit.

Naravel.Notifications.Mail

Optional Naravel.Notifications adapter: a "mail" channel that delivers a notification through Naravel.Mail.

Naravel.Mail.Queue

Optional Naravel.Mail adapter that delivers mail through Naravel.Queue: QueueAsync stores only the built message data.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 319 11/13/2026
0.1.1 129 11/2/2026
0.1.0 138 11/1/2026