Soenneker.Email.Dispatcher 4.0.503

Prefix Reserved
dotnet add package Soenneker.Email.Dispatcher --version 4.0.503
                    
NuGet\Install-Package Soenneker.Email.Dispatcher -Version 4.0.503
                    
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.503" />
                    
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.503" />
                    
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.503
                    
#r "nuget: Soenneker.Email.Dispatcher, 4.0.503"
                    
#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.503
                    
#: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.503
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Email.Dispatcher&version=4.0.503
                    
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.503 128 10/15/2026
4.0.502 183 10/15/2026
4.0.501 83 10/15/2026
4.0.500 124 10/15/2026
4.0.499 82 10/14/2026
4.0.498 85 10/14/2026
4.0.495 132 10/14/2026
4.0.494 78 10/14/2026
4.0.493 81 10/14/2026
4.0.487 177 10/13/2026
4.0.486 82 10/12/2026
4.0.484 112 10/12/2026
4.0.483 205 10/12/2026
4.0.482 126 10/11/2026
4.0.481 95 10/11/2026
4.0.480 126 10/11/2026
4.0.479 198 10/9/2026
4.0.478 248 10/6/2026
4.0.477 306 10/1/2026
4.0.476 123 10/1/2026
Loading failed

Updated Soenneker.Email.Util to 4.0.724