Soenneker.Extensions.Dtos.Email
4.0.381
Prefix Reserved
dotnet add package Soenneker.Extensions.Dtos.Email --version 4.0.381
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 4.0.381
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="4.0.381" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.Dtos.Email" Version="4.0.381" />
<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 4.0.381
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Extensions.Dtos.Email, 4.0.381"
#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@4.0.381
#: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=4.0.381
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=4.0.381
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 | 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.
-
net10.0
- MimeKit (>= 4.17.0)
- Soenneker.Dtos.Email (>= 4.0.244)
- Soenneker.Extensions.Enumerable.String (>= 4.0.1379)
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.381 | 172 | 6/20/2026 |
| 4.0.380 | 152 | 6/20/2026 |
| 4.0.379 | 153 | 6/20/2026 |
| 4.0.378 | 114 | 6/19/2026 |
| 4.0.377 | 100 | 6/19/2026 |
| 4.0.376 | 101 | 6/19/2026 |
| 4.0.375 | 157 | 6/19/2026 |
| 4.0.374 | 100 | 6/19/2026 |
| 4.0.373 | 95 | 6/18/2026 |
| 4.0.372 | 134 | 6/18/2026 |
| 4.0.371 | 91 | 6/18/2026 |
| 4.0.370 | 169 | 6/17/2026 |
| 4.0.369 | 110 | 6/16/2026 |
| 4.0.368 | 200 | 6/10/2026 |
| 4.0.367 | 122 | 6/10/2026 |
| 4.0.366 | 203 | 6/9/2026 |
| 4.0.365 | 198 | 6/6/2026 |
| 4.0.364 | 140 | 6/6/2026 |
| 4.0.363 | 108 | 6/6/2026 |
| 4.0.362 | 133 | 6/6/2026 |
Loading failed
Update dependency Soenneker.Extensions.Enumerable.String to 4.0.1379 (#821)