Soenneker.Extensions.Dtos.Email
4.0.358
Prefix Reserved
dotnet add package Soenneker.Extensions.Dtos.Email --version 4.0.358
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 4.0.358
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.358" />
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.358" />
<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.358
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Extensions.Dtos.Email, 4.0.358"
#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.358
#: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.358
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=4.0.358
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.233)
- Soenneker.Extensions.Enumerable.String (>= 4.0.1356)
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.358 | 59 | 5/26/2026 |
| 4.0.357 | 196 | 5/13/2026 |
| 4.0.356 | 281 | 5/2/2026 |
| 4.0.355 | 144 | 5/2/2026 |
| 4.0.354 | 134 | 5/1/2026 |
| 4.0.353 | 198 | 4/26/2026 |
| 4.0.352 | 162 | 4/23/2026 |
| 4.0.351 | 154 | 4/23/2026 |
| 4.0.350 | 141 | 4/23/2026 |
| 4.0.349 | 112 | 4/23/2026 |
| 4.0.347 | 283 | 4/21/2026 |
| 4.0.346 | 119 | 4/15/2026 |
| 4.0.345 | 179 | 4/14/2026 |
| 4.0.344 | 254 | 3/31/2026 |
| 4.0.343 | 116 | 3/31/2026 |
| 4.0.342 | 118 | 3/31/2026 |
| 4.0.341 | 231 | 3/20/2026 |
| 4.0.340 | 117 | 3/19/2026 |
| 4.0.339 | 170 | 3/15/2026 |
| 4.0.338 | 125 | 3/15/2026 |
Loading failed
Update dependency MimeKit to 4.17.0 (#753)