Soenneker.Email.Dispatcher 4.0.415

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Email.Dispatcher --version 4.0.415
                    
NuGet\Install-Package Soenneker.Email.Dispatcher -Version 4.0.415
                    
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.415" />
                    
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.415" />
                    
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.415
                    
#r "nuget: Soenneker.Email.Dispatcher, 4.0.415"
                    
#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.415
                    
#: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.415
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Email.Dispatcher&version=4.0.415
                    
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.442 44 9/10/2026
4.0.441 58 9/10/2026
4.0.440 62 9/9/2026
4.0.439 52 9/9/2026
4.0.438 50 9/9/2026
4.0.437 80 9/9/2026
4.0.436 112 9/8/2026
4.0.435 80 9/8/2026
4.0.434 95 9/8/2026
4.0.433 111 9/8/2026
4.0.431 106 9/7/2026
4.0.430 95 9/7/2026
4.0.429 146 9/6/2026
4.0.428 94 9/5/2026
4.0.427 101 9/5/2026
4.0.426 83 9/4/2026
4.0.425 58 9/4/2026
4.0.424 137 9/4/2026
4.0.423 98 9/4/2026
4.0.415 123 9/1/2026
Loading failed

Updated NuGet packages