Soenneker.Email.Util
4.0.652
Prefix Reserved
dotnet add package Soenneker.Email.Util --version 4.0.652
NuGet\Install-Package Soenneker.Email.Util -Version 4.0.652
<PackageReference Include="Soenneker.Email.Util" Version="4.0.652" />
<PackageVersion Include="Soenneker.Email.Util" Version="4.0.652" />
<PackageReference Include="Soenneker.Email.Util" />
paket add Soenneker.Email.Util --version 4.0.652
#r "nuget: Soenneker.Email.Util, 4.0.652"
#:package Soenneker.Email.Util@4.0.652
#addin nuget:?package=Soenneker.Email.Util&version=4.0.652
#tool nuget:?package=Soenneker.Email.Util&version=4.0.652
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 | Versions 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. |
-
net10.0
- Soenneker.ServiceBus.Transmitter (>= 4.0.3893)
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.652 | 0 | 9/5/2026 |
| 4.0.651 | 0 | 9/5/2026 |
| 4.0.650 | 0 | 9/4/2026 |
| 4.0.649 | 35 | 9/4/2026 |
| 4.0.648 | 45 | 9/4/2026 |
| 4.0.647 | 50 | 9/4/2026 |
| 4.0.646 | 58 | 9/4/2026 |
| 4.0.645 | 47 | 9/4/2026 |
| 4.0.644 | 37 | 9/4/2026 |
| 4.0.643 | 58 | 9/4/2026 |
| 4.0.642 | 123 | 9/1/2026 |
| 4.0.641 | 76 | 9/1/2026 |
| 4.0.640 | 68 | 9/1/2026 |
| 4.0.637 | 202 | 9/1/2026 |
| 4.0.636 | 83 | 8/31/2026 |
| 4.0.635 | 85 | 8/31/2026 |
| 4.0.634 | 129 | 8/31/2026 |
| 4.0.633 | 144 | 8/31/2026 |
| 4.0.632 | 96 | 8/31/2026 |
| 4.0.631 | 155 | 8/30/2026 |
Update dependency Soenneker.ServiceBus.Transmitter to 4.0.3893 (#1191)