Soenneker.Email.Util 4.0.643

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Email.Util --version 4.0.643
                    
NuGet\Install-Package Soenneker.Email.Util -Version 4.0.643
                    
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.Util" Version="4.0.643" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Email.Util" Version="4.0.643" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Email.Util" />
                    
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.Util --version 4.0.643
                    
#r "nuget: Soenneker.Email.Util, 4.0.643"
                    
#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.Util@4.0.643
                    
#: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.Util&version=4.0.643
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Email.Util&version=4.0.643
                    
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.Util

Queues an EmailMessage—or another Message envelope—for asynchronous transmission to Azure Service Bus through IServiceBusTransmitter.

Install

dotnet add package Soenneker.Email.Util

Configuration

{
  "Azure": {
    "ServiceBus": {
      "Enable": true,
      "ConnectionString": "use-a-secret-provider",
      "TransmitterLogging": false
    }
  }
}

Enable and ConnectionString are required by the registered Service Bus components. Keep the connection string in a secret provider. TransmitterLogging is optional and should remain false when message bodies may contain personal or confidential data.

Registration

using Soenneker.Email.Util.Registrars;

services.AddEmailUtilAsSingleton();

For a scoped wrapper:

services.AddEmailUtilAsScoped();

The scoped registration creates IEmailUtil and its transmitter per scope while intentionally retaining the background queue, message utility, sender utility, and underlying Service Bus client as shared singleton infrastructure. Ending a scope therefore disposes the wrapper without tearing down and recreating the shared client.

Queue an email

using Soenneker.Email.Util.Abstract;
using Soenneker.Enums.Email.Format;
using Soenneker.Enums.Email.Priority;
using Soenneker.Messages.Email;

var message = new EmailMessage
{
    Type = "email.receipt.v1",
    Id = Guid.NewGuid().ToString("N"),
    Queue = "email",
    Sender = "orders-api",
    CreatedAt = DateTimeOffset.UtcNow,
    To = ["recipient@example.net"],
    Subject = "Your receipt",
    Format = EmailFormat.Html,
    Priority = EmailPriority.Normal,
    ContentFileName = "receipt.html"
};

IEmailUtil email = serviceProvider.GetRequiredService<IEmailUtil>();
await email.PlaceOnQueue(message, cancellationToken);

PlaceOnQueue uses the transmitter's in-process background queue. Completion means that queue accepted the work item; it does not mean Azure Service Bus accepted the message or that an email was delivered. Transmission failures are handled and logged by the transmitter.

When Service Bus is disabled, the transmitter logs a warning and skips the message. Cancellation can stop work that has not completed, but it cannot retract a message already sent to Service Bus.

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.Util:

Package Downloads
Soenneker.Email.Dispatcher

Determines email dispatching/routing

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.651 0 9/5/2026
4.0.650 0 9/4/2026
4.0.649 0 9/4/2026
4.0.648 0 9/4/2026
4.0.647 0 9/4/2026
4.0.646 26 9/4/2026
4.0.645 43 9/4/2026
4.0.644 34 9/4/2026
4.0.643 52 9/4/2026
4.0.642 120 9/1/2026
4.0.641 73 9/1/2026
4.0.640 67 9/1/2026
4.0.637 195 9/1/2026
4.0.636 82 8/31/2026
4.0.635 85 8/31/2026
4.0.634 127 8/31/2026
4.0.633 142 8/31/2026
4.0.632 95 8/31/2026
4.0.631 153 8/30/2026
4.0.630 83 8/30/2026
Loading failed

Updated Soenneker.ServiceBus.Transmitter to 4.0.3883