Soenneker.Extensions.Dtos.Email 3.0.36

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.Dtos.Email --version 3.0.36
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.36
                    
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.36" />
                    
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.36" />
                    
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.36
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.36"
                    
#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@3.0.36
                    
#: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=3.0.36
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.36
                    
Install 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.  net10.0 was computed.  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.

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.192 9 7/29/2025
3.0.191 10 7/29/2025
3.0.190 203 7/9/2025
3.0.189 153 7/9/2025
3.0.188 150 7/8/2025
3.0.187 231 6/28/2025
3.0.186 60 6/28/2025
3.0.185 100 6/28/2025
3.0.184 93 6/27/2025
3.0.183 57 6/27/2025
3.0.182 96 6/27/2025
3.0.181 175 6/25/2025
3.0.180 157 6/25/2025
3.0.179 156 6/24/2025
3.0.178 409 6/11/2025
3.0.177 303 6/11/2025
3.0.176 297 6/11/2025
3.0.175 320 6/11/2025
3.0.174 302 6/10/2025
3.0.173 328 6/3/2025
3.0.172 134 6/2/2025
3.0.171 199 6/2/2025
3.0.170 209 5/28/2025
3.0.169 138 5/28/2025
3.0.168 137 5/27/2025
3.0.167 229 5/27/2025
3.0.166 167 5/27/2025
3.0.165 142 5/27/2025
3.0.164 155 5/27/2025
3.0.163 139 5/27/2025
3.0.162 136 5/27/2025
3.0.161 215 5/25/2025
3.0.160 142 5/25/2025
3.0.159 215 5/23/2025
3.0.158 119 5/23/2025
3.0.157 116 5/23/2025
3.0.156 115 5/23/2025
3.0.155 121 5/23/2025
3.0.154 132 5/23/2025
3.0.153 138 5/22/2025
3.0.152 134 5/22/2025
3.0.151 505 5/14/2025
3.0.150 279 5/14/2025
3.0.149 226 5/14/2025
3.0.148 310 5/8/2025
3.0.147 139 5/8/2025
3.0.146 214 5/8/2025
3.0.145 146 5/8/2025
3.0.144 145 5/8/2025
3.0.143 143 5/8/2025
3.0.142 139 5/7/2025
3.0.141 149 5/7/2025
3.0.140 141 5/7/2025
3.0.139 348 5/6/2025
3.0.138 163 5/5/2025
3.0.137 159 5/5/2025
3.0.136 167 5/5/2025
3.0.135 157 5/5/2025
3.0.134 142 5/5/2025
3.0.133 167 5/5/2025
3.0.132 134 5/5/2025
3.0.131 133 5/5/2025
3.0.130 195 5/5/2025
3.0.129 139 5/5/2025
3.0.128 171 5/5/2025
3.0.126 176 5/5/2025
3.0.125 254 4/29/2025
3.0.124 214 4/27/2025
3.0.123 98 4/27/2025
3.0.122 161 4/26/2025
3.0.121 76 4/26/2025
3.0.120 427 4/9/2025
3.0.119 171 4/9/2025
3.0.118 165 4/9/2025
3.0.117 168 4/8/2025
3.0.116 173 4/8/2025
3.0.115 160 4/8/2025
3.0.114 158 4/8/2025
3.0.113 166 4/8/2025
3.0.112 158 4/8/2025
3.0.111 169 4/8/2025
3.0.110 163 4/8/2025
3.0.109 177 4/8/2025
3.0.108 160 4/8/2025
3.0.107 434 4/8/2025
3.0.106 147 4/8/2025
3.0.105 154 4/8/2025
3.0.104 176 4/8/2025
3.0.103 165 4/8/2025
3.0.102 164 4/8/2025
3.0.101 156 4/8/2025
3.0.100 157 4/8/2025
3.0.99 159 4/8/2025
3.0.98 160 4/8/2025
3.0.97 165 4/8/2025
3.0.96 150 4/8/2025
3.0.95 160 4/8/2025
3.0.94 149 4/7/2025
3.0.93 165 4/7/2025
3.0.92 160 4/7/2025
3.0.91 387 4/7/2025
3.0.90 159 4/7/2025
3.0.89 160 4/7/2025
3.0.88 212 4/7/2025
3.0.87 156 4/7/2025
3.0.86 164 4/7/2025
3.0.85 174 4/7/2025
3.0.84 157 4/7/2025
3.0.83 273 4/7/2025
3.0.82 161 4/7/2025
3.0.81 164 4/7/2025
3.0.80 160 4/7/2025
3.0.79 158 4/7/2025
3.0.78 234 4/7/2025
3.0.77 159 4/7/2025
3.0.76 162 4/7/2025
3.0.75 199 4/7/2025
3.0.74 164 4/7/2025
3.0.73 186 4/6/2025
3.0.72 161 4/6/2025
3.0.71 154 4/6/2025
3.0.70 167 4/6/2025
3.0.69 154 4/6/2025
3.0.68 152 4/6/2025
3.0.67 178 4/6/2025
3.0.66 133 4/6/2025
3.0.65 147 4/6/2025
3.0.64 140 4/6/2025
3.0.63 136 4/6/2025
3.0.62 128 4/6/2025
3.0.61 141 4/6/2025
3.0.60 144 4/6/2025
3.0.59 116 4/6/2025
3.0.58 108 4/6/2025
3.0.57 111 4/6/2025
3.0.56 128 4/6/2025
3.0.55 124 4/6/2025
3.0.54 111 4/6/2025
3.0.53 134 4/5/2025
3.0.52 86 4/5/2025
3.0.51 95 4/5/2025
3.0.50 124 4/5/2025
3.0.49 95 4/5/2025
3.0.48 108 4/5/2025
3.0.47 90 4/5/2025
3.0.46 96 4/5/2025
3.0.45 91 4/5/2025
3.0.44 145 4/5/2025
3.0.43 98 4/5/2025
3.0.42 120 4/5/2025
3.0.41 85 4/5/2025
3.0.40 91 4/4/2025
3.0.39 113 4/4/2025
3.0.38 397 4/4/2025
3.0.37 209 4/4/2025
3.0.36 158 4/4/2025
3.0.35 167 4/4/2025
3.0.34 168 4/4/2025
3.0.33 270 4/3/2025
3.0.32 170 4/3/2025
3.0.31 182 4/1/2025
3.0.30 146 4/1/2025
3.0.29 230 4/1/2025
3.0.28 150 4/1/2025
3.0.27 145 4/1/2025
3.0.26 226 4/1/2025
3.0.25 258 4/1/2025
3.0.24 155 4/1/2025
3.0.23 216 4/1/2025
3.0.22 158 3/31/2025
3.0.21 148 3/31/2025
3.0.20 152 3/31/2025
3.0.19 153 3/31/2025
3.0.18 304 3/31/2025
3.0.17 176 3/29/2025
3.0.16 95 3/29/2025
3.0.15 117 3/29/2025
3.0.14 102 3/29/2025
3.0.13 98 3/29/2025
3.0.12 89 3/29/2025
3.0.11 271 3/27/2025
3.0.10 521 3/26/2025
3.0.9 466 3/26/2025
3.0.8 483 3/25/2025
3.0.7 512 3/25/2025
3.0.6 468 3/25/2025
3.0.5 467 3/25/2025
3.0.4 479 3/25/2025
3.0.3 473 3/25/2025
3.0.2 435 3/23/2025
3.0.1 123 3/21/2025