Soenneker.Extensions.Dtos.Email 3.0.120

Prefix Reserved
dotnet add package Soenneker.Extensions.Dtos.Email --version 3.0.120
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.120
                    
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.120" />
                    
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.120" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.Dtos.Email" />
                    
Project file
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.120
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.120"
                    
#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.120
                    
Install Soenneker.Extensions.Dtos.Email as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.120
                    
Install Soenneker.Extensions.Dtos.Email as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Extensions.Dtos.Email

A collection of helpful EmailDto extension methods

๐Ÿ“ง Features

  • Converts a well-defined EmailDto into a MimeKit MimeMessage
  • Supports both html and plain formats
  • Adds To, Cc, Bcc, and Reply-To addresses
  • Automatically attaches files via EmailAttachmentDto
  • Sets headers for High and Low priority emails
  • Logs malformed recipients using ILogger

๐Ÿงช Validation

The extension validates:

  • Required fields: To, Subject, and Body
  • 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 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.

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.120 258 4/9/2025
3.0.119 121 4/9/2025
3.0.118 117 4/9/2025
3.0.117 125 4/8/2025
3.0.116 135 4/8/2025
3.0.115 137 4/8/2025
3.0.114 137 4/8/2025
3.0.113 139 4/8/2025
3.0.112 135 4/8/2025
3.0.111 141 4/8/2025
3.0.110 141 4/8/2025
3.0.109 143 4/8/2025
3.0.108 133 4/8/2025
3.0.107 350 4/8/2025
3.0.106 133 4/8/2025
3.0.105 132 4/8/2025
3.0.104 146 4/8/2025
3.0.103 136 4/8/2025
3.0.102 139 4/8/2025
3.0.101 136 4/8/2025
3.0.100 138 4/8/2025
3.0.99 136 4/8/2025
3.0.98 130 4/8/2025
3.0.97 142 4/8/2025
3.0.96 132 4/8/2025
3.0.95 135 4/8/2025
3.0.94 130 4/7/2025
3.0.93 140 4/7/2025
3.0.92 129 4/7/2025
3.0.91 365 4/7/2025
3.0.90 136 4/7/2025
3.0.89 136 4/7/2025
3.0.88 190 4/7/2025
3.0.87 135 4/7/2025
3.0.86 137 4/7/2025
3.0.85 142 4/7/2025
3.0.84 138 4/7/2025
3.0.83 254 4/7/2025
3.0.82 135 4/7/2025
3.0.81 140 4/7/2025
3.0.80 137 4/7/2025
3.0.79 135 4/7/2025
3.0.78 209 4/7/2025
3.0.77 139 4/7/2025
3.0.76 142 4/7/2025
3.0.75 176 4/7/2025
3.0.74 140 4/7/2025
3.0.73 167 4/6/2025
3.0.72 135 4/6/2025
3.0.71 137 4/6/2025
3.0.70 146 4/6/2025
3.0.69 135 4/6/2025
3.0.68 132 4/6/2025
3.0.67 151 4/6/2025
3.0.66 108 4/6/2025
3.0.65 126 4/6/2025
3.0.64 119 4/6/2025
3.0.63 116 4/6/2025
3.0.62 108 4/6/2025
3.0.61 117 4/6/2025
3.0.60 122 4/6/2025
3.0.59 93 4/6/2025
3.0.58 86 4/6/2025
3.0.57 91 4/6/2025
3.0.56 108 4/6/2025
3.0.55 91 4/6/2025
3.0.54 89 4/6/2025
3.0.53 114 4/5/2025
3.0.52 67 4/5/2025
3.0.51 73 4/5/2025
3.0.50 98 4/5/2025
3.0.49 71 4/5/2025
3.0.48 86 4/5/2025
3.0.47 70 4/5/2025
3.0.46 71 4/5/2025
3.0.45 71 4/5/2025
3.0.44 119 4/5/2025
3.0.43 75 4/5/2025
3.0.42 90 4/5/2025
3.0.41 65 4/5/2025
3.0.40 72 4/4/2025
3.0.39 89 4/4/2025
3.0.38 379 4/4/2025
3.0.37 193 4/4/2025
3.0.36 142 4/4/2025
3.0.35 139 4/4/2025
3.0.34 152 4/4/2025
3.0.33 237 4/3/2025
3.0.32 138 4/3/2025
3.0.31 164 4/1/2025
3.0.30 129 4/1/2025
3.0.29 202 4/1/2025
3.0.28 130 4/1/2025
3.0.27 128 4/1/2025
3.0.26 212 4/1/2025
3.0.25 239 4/1/2025
3.0.24 134 4/1/2025
3.0.23 194 4/1/2025
3.0.22 134 3/31/2025
3.0.21 127 3/31/2025
3.0.20 136 3/31/2025
3.0.19 138 3/31/2025
3.0.18 283 3/31/2025
3.0.17 157 3/29/2025
3.0.16 75 3/29/2025
3.0.15 84 3/29/2025
3.0.14 84 3/29/2025
3.0.13 78 3/29/2025
3.0.12 71 3/29/2025
3.0.11 246 3/27/2025
3.0.10 501 3/26/2025
3.0.9 450 3/26/2025
3.0.8 462 3/25/2025
3.0.7 486 3/25/2025
3.0.6 449 3/25/2025
3.0.5 447 3/25/2025
3.0.4 457 3/25/2025
3.0.3 451 3/25/2025
3.0.2 412 3/23/2025
3.0.1 105 3/21/2025