Soenneker.Email.Dispatcher 4.0.421

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

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Email.Dispatcher

Routes an EmailMessage either to Azure Service Bus or directly to an IEmailSender, based on the Email:UseQueue configuration value.

Install

dotnet add package Soenneker.Email.Dispatcher

Configure routing

{
  "Email": {
    "UseQueue": false
  }
}

The value is required and is read when EmailDispatcher is constructed. Changing configuration afterward does not change an existing dispatcher's route.

Register an IEmailSender, then choose the dispatcher lifetime that matches the consuming application:

using Microsoft.Extensions.DependencyInjection;
using Soenneker.Email.Dispatcher.Abstract;
using Soenneker.Email.Dispatcher.Registrars;
using Soenneker.Email.Senders.Abstract;

services.AddSingleton<IEmailSender, AppEmailSender>();
services.AddEmailDispatcherAsSingleton();

The singleton registration also registers the queue utility as singleton. Its IEmailSender dependency must be safe to capture and use for the application lifetime. Use AddEmailDispatcherAsScoped() with a scoped sender when dispatch behavior depends on request-scoped services.

Both registrations add the email utility and its Service Bus transmitter dependencies. An IEmailSender registration is still required even when queue routing is enabled because the dispatcher receives both routes through its constructor.

Dispatch a message

IEmailDispatcher dispatcher = serviceProvider.GetRequiredService<IEmailDispatcher>();

await dispatcher.Dispatch(message, cancellationToken);

With UseQueue: true, completion means the message was accepted by the configured Service Bus transmitter; delivery occurs later. With UseQueue: false, completion means the sender returned true. A false result from the sender becomes an InvalidOperationException so a failed direct send is not silently treated as success.

Cancellation stops pending work when the underlying route observes the token; it cannot retract a message already queued or sent.

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 (1)

Showing the top 1 NuGet packages that depend on Soenneker.Email.Dispatcher:

Package Downloads
Soenneker.Email.Support

A utility that allows for quick access to support email sending

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.421 0 9/4/2026
4.0.419 0 9/4/2026
4.0.418 0 9/4/2026
4.0.417 76 9/1/2026
4.0.416 69 9/1/2026
4.0.415 83 9/1/2026
4.0.414 85 9/1/2026
4.0.413 83 9/1/2026
4.0.412 89 8/31/2026
4.0.411 106 8/31/2026
4.0.410 63 8/31/2026
4.0.409 90 8/31/2026
4.0.408 72 8/31/2026
4.0.407 114 8/30/2026
4.0.406 65 8/30/2026
4.0.405 129 8/30/2026
4.0.403 65 8/29/2026
4.0.402 236 8/27/2026
4.0.401 133 8/27/2026
4.0.400 129 8/26/2026
Loading failed

Updated Multiple NuGet packages