Soenneker.Extensions.Dtos.Email
3.0.11
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.11
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.11
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.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soenneker.Extensions.Dtos.Email --version 3.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.11"
#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.
// Install Soenneker.Extensions.Dtos.Email as a Cake Addin #addin nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.11 // Install Soenneker.Extensions.Dtos.Email as a Cake Tool #tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.11
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.12)
- Soenneker.Extensions.Enumerable.String (>= 3.0.1092)
- 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.17 | 58 | 3/29/2025 |
3.0.16 | 44 | 3/29/2025 |
3.0.15 | 47 | 3/29/2025 |
3.0.14 | 48 | 3/29/2025 |
3.0.13 | 48 | 3/29/2025 |
3.0.12 | 41 | 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 | 373 | 3/23/2025 |
3.0.1 | 92 | 3/21/2025 |