Soenneker.Extensions.Dtos.Email 3.0.128

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.128
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.128
                    
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.128" />
                    
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.128" />
                    
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.128
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.128"
                    
#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.128
                    
#: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.128
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.128
                    
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.218 99 9/16/2025
3.0.217 145 9/10/2025
3.0.216 152 9/9/2025
3.0.215 126 9/9/2025
3.0.214 143 9/9/2025
3.0.213 188 9/4/2025
3.0.212 158 9/3/2025
3.0.211 156 9/3/2025
3.0.210 153 9/3/2025
3.0.209 142 9/3/2025
3.0.208 137 9/3/2025
3.0.207 137 9/3/2025
3.0.206 180 8/17/2025
3.0.205 112 8/17/2025
3.0.204 147 8/15/2025
3.0.203 143 8/15/2025
3.0.202 158 8/11/2025
3.0.201 169 8/11/2025
3.0.200 121 8/11/2025
3.0.199 124 8/11/2025
3.0.198 124 8/11/2025
3.0.197 192 8/11/2025
3.0.196 151 8/11/2025
3.0.195 130 8/11/2025
3.0.194 240 8/5/2025
3.0.193 234 8/5/2025
3.0.192 130 7/29/2025
3.0.191 98 7/29/2025
3.0.190 432 7/9/2025
3.0.189 161 7/9/2025
3.0.188 159 7/8/2025
3.0.187 240 6/28/2025
3.0.186 68 6/28/2025
3.0.185 107 6/28/2025
3.0.184 100 6/27/2025
3.0.183 66 6/27/2025
3.0.182 108 6/27/2025
3.0.181 190 6/25/2025
3.0.180 169 6/25/2025
3.0.179 163 6/24/2025
3.0.178 419 6/11/2025
3.0.177 309 6/11/2025
3.0.176 304 6/11/2025
3.0.175 330 6/11/2025
3.0.174 310 6/10/2025
3.0.173 337 6/3/2025
3.0.172 141 6/2/2025
3.0.171 206 6/2/2025
3.0.170 225 5/28/2025
3.0.169 147 5/28/2025
3.0.168 144 5/27/2025
3.0.167 239 5/27/2025
3.0.166 176 5/27/2025
3.0.165 153 5/27/2025
3.0.164 165 5/27/2025
3.0.163 148 5/27/2025
3.0.162 143 5/27/2025
3.0.161 223 5/25/2025
3.0.160 156 5/25/2025
3.0.159 227 5/23/2025
3.0.158 127 5/23/2025
3.0.157 124 5/23/2025
3.0.156 123 5/23/2025
3.0.155 128 5/23/2025
3.0.154 140 5/23/2025
3.0.153 153 5/22/2025
3.0.152 146 5/22/2025
3.0.151 518 5/14/2025
3.0.150 286 5/14/2025
3.0.149 239 5/14/2025
3.0.148 317 5/8/2025
3.0.147 147 5/8/2025
3.0.146 222 5/8/2025
3.0.145 157 5/8/2025
3.0.144 154 5/8/2025
3.0.143 155 5/8/2025
3.0.142 147 5/7/2025
3.0.141 159 5/7/2025
3.0.140 149 5/7/2025
3.0.139 361 5/6/2025
3.0.138 181 5/5/2025
3.0.137 169 5/5/2025
3.0.136 174 5/5/2025
3.0.135 166 5/5/2025
3.0.134 156 5/5/2025
3.0.133 180 5/5/2025
3.0.132 143 5/5/2025
3.0.131 140 5/5/2025
3.0.130 202 5/5/2025
3.0.129 147 5/5/2025
3.0.128 185 5/5/2025
3.0.126 188 5/5/2025
3.0.125 262 4/29/2025
3.0.124 222 4/27/2025
3.0.123 105 4/27/2025
3.0.122 171 4/26/2025
3.0.121 89 4/26/2025
3.0.120 441 4/9/2025
3.0.119 181 4/9/2025
3.0.118 174 4/9/2025
3.0.117 177 4/8/2025
3.0.116 181 4/8/2025
3.0.115 176 4/8/2025
3.0.114 173 4/8/2025
3.0.113 175 4/8/2025
3.0.112 169 4/8/2025
3.0.111 176 4/8/2025
3.0.110 174 4/8/2025
3.0.109 186 4/8/2025
3.0.108 169 4/8/2025
3.0.107 444 4/8/2025
3.0.106 158 4/8/2025
3.0.105 165 4/8/2025
3.0.104 189 4/8/2025
3.0.103 175 4/8/2025
3.0.102 173 4/8/2025
3.0.101 164 4/8/2025
3.0.100 165 4/8/2025
3.0.99 168 4/8/2025
3.0.98 173 4/8/2025
3.0.97 175 4/8/2025
3.0.96 158 4/8/2025
3.0.95 171 4/8/2025
3.0.94 156 4/7/2025
3.0.93 175 4/7/2025
3.0.92 172 4/7/2025
3.0.91 397 4/7/2025
3.0.90 168 4/7/2025
3.0.89 171 4/7/2025
3.0.88 221 4/7/2025
3.0.87 169 4/7/2025
3.0.86 179 4/7/2025
3.0.85 187 4/7/2025
3.0.84 165 4/7/2025
3.0.83 282 4/7/2025
3.0.82 169 4/7/2025
3.0.81 173 4/7/2025
3.0.80 168 4/7/2025
3.0.79 168 4/7/2025
3.0.78 244 4/7/2025
3.0.77 171 4/7/2025
3.0.76 172 4/7/2025
3.0.75 207 4/7/2025
3.0.74 171 4/7/2025
3.0.73 192 4/6/2025
3.0.72 173 4/6/2025
3.0.71 160 4/6/2025
3.0.70 182 4/6/2025
3.0.69 161 4/6/2025
3.0.68 160 4/6/2025
3.0.67 186 4/6/2025
3.0.66 143 4/6/2025
3.0.65 157 4/6/2025
3.0.64 150 4/6/2025
3.0.63 147 4/6/2025
3.0.62 137 4/6/2025
3.0.61 154 4/6/2025
3.0.60 153 4/6/2025
3.0.59 127 4/6/2025
3.0.58 123 4/6/2025
3.0.57 123 4/6/2025
3.0.56 137 4/6/2025
3.0.55 138 4/6/2025
3.0.54 118 4/6/2025
3.0.53 142 4/5/2025
3.0.52 95 4/5/2025
3.0.51 104 4/5/2025
3.0.50 141 4/5/2025
3.0.49 102 4/5/2025
3.0.48 116 4/5/2025
3.0.47 98 4/5/2025
3.0.46 107 4/5/2025
3.0.45 99 4/5/2025
3.0.44 158 4/5/2025
3.0.43 110 4/5/2025
3.0.42 131 4/5/2025
3.0.41 93 4/5/2025
3.0.40 103 4/4/2025
3.0.39 123 4/4/2025
3.0.38 414 4/4/2025
3.0.37 217 4/4/2025
3.0.36 166 4/4/2025
3.0.35 180 4/4/2025
3.0.34 175 4/4/2025
3.0.33 283 4/3/2025
3.0.32 183 4/3/2025
3.0.31 190 4/1/2025
3.0.30 153 4/1/2025
3.0.29 240 4/1/2025
3.0.28 165 4/1/2025
3.0.27 161 4/1/2025
3.0.26 235 4/1/2025
3.0.25 265 4/1/2025
3.0.24 169 4/1/2025
3.0.23 224 4/1/2025
3.0.22 168 3/31/2025
3.0.21 155 3/31/2025
3.0.20 159 3/31/2025
3.0.19 161 3/31/2025
3.0.18 313 3/31/2025
3.0.17 185 3/29/2025
3.0.16 102 3/29/2025
3.0.15 128 3/29/2025
3.0.14 111 3/29/2025
3.0.13 109 3/29/2025
3.0.12 95 3/29/2025
3.0.11 280 3/27/2025
3.0.10 529 3/26/2025
3.0.9 474 3/26/2025
3.0.8 490 3/25/2025
3.0.7 525 3/25/2025
3.0.6 481 3/25/2025
3.0.5 473 3/25/2025
3.0.4 487 3/25/2025
3.0.3 481 3/25/2025
3.0.2 448 3/23/2025
3.0.1 131 3/21/2025