Soenneker.Extensions.Dtos.Email
3.0.31
Prefix Reserved
dotnet add package Soenneker.Extensions.Dtos.Email --version 3.0.31
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.31
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.31" />
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.31" />
<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.31
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.31"
#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.
#addin nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.31
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.31
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
EmailDto
into a MimeKitMimeMessage
- Supports both
html
andplain
formats - Adds
To
,Cc
,Bcc
, andReply-To
addresses - Automatically attaches files via
EmailAttachmentDto
- Sets headers for
High
andLow
priority 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. |
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.28)
- Soenneker.Extensions.Enumerable.String (>= 3.0.1099)
- Soenneker.Extensions.String (>= 3.0.464)
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 |
---|---|---|
3.0.31 | 0 | 4/1/2025 |
3.0.30 | 0 | 4/1/2025 |
3.0.29 | 0 | 4/1/2025 |
3.0.28 | 0 | 4/1/2025 |
3.0.27 | 0 | 4/1/2025 |
3.0.26 | 0 | 4/1/2025 |
3.0.25 | 43 | 4/1/2025 |
3.0.24 | 27 | 4/1/2025 |
3.0.23 | 57 | 4/1/2025 |
3.0.22 | 30 | 3/31/2025 |
3.0.21 | 24 | 3/31/2025 |
3.0.20 | 32 | 3/31/2025 |
3.0.19 | 29 | 3/31/2025 |
3.0.18 | 106 | 3/31/2025 |
3.0.17 | 88 | 3/29/2025 |
3.0.16 | 46 | 3/29/2025 |
3.0.15 | 49 | 3/29/2025 |
3.0.14 | 50 | 3/29/2025 |
3.0.13 | 50 | 3/29/2025 |
3.0.12 | 43 | 3/29/2025 |
3.0.11 | 151 | 3/27/2025 |
3.0.10 | 456 | 3/26/2025 |
3.0.9 | 421 | 3/26/2025 |
3.0.8 | 435 | 3/25/2025 |
3.0.7 | 469 | 3/25/2025 |
3.0.6 | 439 | 3/25/2025 |
3.0.5 | 439 | 3/25/2025 |
3.0.4 | 450 | 3/25/2025 |
3.0.3 | 445 | 3/25/2025 |
3.0.2 | 374 | 3/23/2025 |
3.0.1 | 93 | 3/21/2025 |