Soenneker.Extensions.Dtos.Email
3.0.60
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Soenneker.Extensions.Dtos.Email --version 3.0.60
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.60
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.Extensions.Dtos.Email" Version="3.0.60" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.Dtos.Email" Version="3.0.60" />
<PackageReference Include="Soenneker.Extensions.Dtos.Email" />
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.Extensions.Dtos.Email --version 3.0.60
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.60"
#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.Extensions.Dtos.Email@3.0.60
#: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.Extensions.Dtos.Email&version=3.0.60
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.60
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Soenneker.Extensions.Dtos.Email
A collection of helpful EmailDto extension methods
๐ง Features
- Converts a well-defined
EmailDtointo a MimeKitMimeMessage - Supports both
htmlandplainformats - Adds
To,Cc,Bcc, andReply-Toaddresses - Automatically attaches files via
EmailAttachmentDto - Sets headers for
HighandLowpriority emails - Logs malformed recipients using
ILogger
๐งช Validation
The extension validates:
- Required fields:
To,Subject, andBody - Non-null, non-whitespace addresses
- Optionally logs issues rather than throwing for individual recipient fields
Installation
dotnet add package Soenneker.Extensions.Dtos.Email
๐ง Usage
var mimeMessage = emailDto.ToMimeMessage(logger);
๐ Example EmailDto
var dto = new EmailDto
{
To = new List<string> { "to@example.com" },
Cc = new List<string> { "cc@example.com" },
Bcc = new List<string> { "bcc@example.com" },
ReplyTo = "reply@example.com",
Name = "Sender Name",
Address = "sender@example.com",
Subject = "Test Subject",
Body = "<p>This is a test email.</p>",
Format = EmailFormat.Html,
Priority = EmailPriority.High,
Attachments = new List<EmailAttachmentDto>
{
new EmailAttachmentDto
{
FileName = "test.txt",
MimeType = "text/plain",
Data = Encoding.UTF8.GetBytes("Sample attachment content")
}
}
};
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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.
-
net9.0
- MimeKit (>= 4.11.0)
- Soenneker.Dtos.Email (>= 3.0.55)
- Soenneker.Extensions.Enumerable.String (>= 3.0.1102)
- Soenneker.Extensions.String (>= 3.0.473)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Extensions.Dtos.Email:
| Package | Downloads |
|---|---|
|
Soenneker.Email.Sender
A high-level utility responsible for orchestrating the creation and delivery of templated email messages |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.356 | 0 | 5/2/2026 |
| 4.0.355 | 25 | 5/2/2026 |
| 4.0.354 | 35 | 5/1/2026 |
| 4.0.353 | 166 | 4/26/2026 |
| 4.0.352 | 149 | 4/23/2026 |
| 4.0.351 | 142 | 4/23/2026 |
| 4.0.350 | 130 | 4/23/2026 |
| 4.0.349 | 97 | 4/23/2026 |
| 4.0.347 | 272 | 4/21/2026 |
| 4.0.346 | 110 | 4/15/2026 |
| 4.0.345 | 169 | 4/14/2026 |
| 4.0.344 | 242 | 3/31/2026 |
| 4.0.343 | 103 | 3/31/2026 |
| 4.0.342 | 108 | 3/31/2026 |
| 4.0.341 | 219 | 3/20/2026 |
| 4.0.340 | 109 | 3/19/2026 |
| 4.0.339 | 161 | 3/15/2026 |
| 4.0.338 | 114 | 3/15/2026 |
| 4.0.337 | 151 | 3/13/2026 |
| 3.0.60 | 224 | 4/6/2025 |
Loading failed