Soenneker.Extensions.Dtos.Email 3.0.124

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.124
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.124
                    
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.124" />
                    
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.124" />
                    
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.124
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.124"
                    
#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.124
                    
#: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.124
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.124
                    
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.221 137 9/30/2025
3.0.220 149 9/30/2025
3.0.219 157 9/28/2025
3.0.218 387 9/16/2025
3.0.217 209 9/10/2025
3.0.216 205 9/9/2025
3.0.215 159 9/9/2025
3.0.214 195 9/9/2025
3.0.213 254 9/4/2025
3.0.212 199 9/3/2025
3.0.211 192 9/3/2025
3.0.210 203 9/3/2025
3.0.209 164 9/3/2025
3.0.208 168 9/3/2025
3.0.207 158 9/3/2025
3.0.206 281 8/17/2025
3.0.205 151 8/17/2025
3.0.204 181 8/15/2025
3.0.203 173 8/15/2025
3.0.202 212 8/11/2025
3.0.201 228 8/11/2025
3.0.200 131 8/11/2025
3.0.199 144 8/11/2025
3.0.198 154 8/11/2025
3.0.197 281 8/11/2025
3.0.196 206 8/11/2025
3.0.195 168 8/11/2025
3.0.194 268 8/5/2025
3.0.193 273 8/5/2025
3.0.192 185 7/29/2025
3.0.191 110 7/29/2025
3.0.190 513 7/9/2025
3.0.189 184 7/9/2025
3.0.188 191 7/8/2025
3.0.187 351 6/28/2025
3.0.186 78 6/28/2025
3.0.185 153 6/28/2025
3.0.184 151 6/27/2025
3.0.183 86 6/27/2025
3.0.182 149 6/27/2025
3.0.181 235 6/25/2025
3.0.180 204 6/25/2025
3.0.179 200 6/24/2025
3.0.178 506 6/11/2025
3.0.177 341 6/11/2025
3.0.176 337 6/11/2025
3.0.175 386 6/11/2025
3.0.174 328 6/10/2025
3.0.173 462 6/3/2025
3.0.172 161 6/2/2025
3.0.171 248 6/2/2025
3.0.170 258 5/28/2025
3.0.169 169 5/28/2025
3.0.168 163 5/27/2025
3.0.167 309 5/27/2025
3.0.166 198 5/27/2025
3.0.165 158 5/27/2025
3.0.164 186 5/27/2025
3.0.163 158 5/27/2025
3.0.162 163 5/27/2025
3.0.161 293 5/25/2025
3.0.160 203 5/25/2025
3.0.159 304 5/23/2025
3.0.158 153 5/23/2025
3.0.157 144 5/23/2025
3.0.156 143 5/23/2025
3.0.155 148 5/23/2025
3.0.154 160 5/23/2025
3.0.153 166 5/22/2025
3.0.152 168 5/22/2025
3.0.151 673 5/14/2025
3.0.150 330 5/14/2025
3.0.149 264 5/14/2025
3.0.148 405 5/8/2025
3.0.147 168 5/8/2025
3.0.146 283 5/8/2025
3.0.145 184 5/8/2025
3.0.144 173 5/8/2025
3.0.143 183 5/8/2025
3.0.142 157 5/7/2025
3.0.141 181 5/7/2025
3.0.140 169 5/7/2025
3.0.139 465 5/6/2025
3.0.138 215 5/5/2025
3.0.137 195 5/5/2025
3.0.136 202 5/5/2025
3.0.135 186 5/5/2025
3.0.134 179 5/5/2025
3.0.133 213 5/5/2025
3.0.132 153 5/5/2025
3.0.131 161 5/5/2025
3.0.130 246 5/5/2025
3.0.129 167 5/5/2025
3.0.128 228 5/5/2025
3.0.126 229 5/5/2025
3.0.125 318 4/29/2025
3.0.124 282 4/27/2025
3.0.123 137 4/27/2025
3.0.122 231 4/26/2025
3.0.121 111 4/26/2025
3.0.120 518 4/9/2025
3.0.119 207 4/9/2025
3.0.118 194 4/9/2025
3.0.117 193 4/8/2025
3.0.116 192 4/8/2025
3.0.115 198 4/8/2025
3.0.114 200 4/8/2025
3.0.113 195 4/8/2025
3.0.112 204 4/8/2025
3.0.111 196 4/8/2025
3.0.110 191 4/8/2025
3.0.109 221 4/8/2025
3.0.108 185 4/8/2025
3.0.107 611 4/8/2025
3.0.106 169 4/8/2025
3.0.105 189 4/8/2025
3.0.104 215 4/8/2025
3.0.103 199 4/8/2025
3.0.102 193 4/8/2025
3.0.101 175 4/8/2025
3.0.100 186 4/8/2025
3.0.99 192 4/8/2025
3.0.98 188 4/8/2025
3.0.97 197 4/8/2025
3.0.96 180 4/8/2025
3.0.95 183 4/8/2025
3.0.94 177 4/7/2025
3.0.93 199 4/7/2025
3.0.92 186 4/7/2025
3.0.91 533 4/7/2025
3.0.90 201 4/7/2025
3.0.89 195 4/7/2025
3.0.88 285 4/7/2025
3.0.87 193 4/7/2025
3.0.86 205 4/7/2025
3.0.85 193 4/7/2025
3.0.84 185 4/7/2025
3.0.83 378 4/7/2025
3.0.82 189 4/7/2025
3.0.81 198 4/7/2025
3.0.80 188 4/7/2025
3.0.79 178 4/7/2025
3.0.78 302 4/7/2025
3.0.77 188 4/7/2025
3.0.76 185 4/7/2025
3.0.75 251 4/7/2025
3.0.74 191 4/7/2025
3.0.73 220 4/6/2025
3.0.72 198 4/6/2025
3.0.71 180 4/6/2025
3.0.70 211 4/6/2025
3.0.69 172 4/6/2025
3.0.68 171 4/6/2025
3.0.67 229 4/6/2025
3.0.66 146 4/6/2025
3.0.65 168 4/6/2025
3.0.64 171 4/6/2025
3.0.63 168 4/6/2025
3.0.62 155 4/6/2025
3.0.61 179 4/6/2025
3.0.60 191 4/6/2025
3.0.59 148 4/6/2025
3.0.58 136 4/6/2025
3.0.57 138 4/6/2025
3.0.56 157 4/6/2025
3.0.55 161 4/6/2025
3.0.54 138 4/6/2025
3.0.53 179 4/5/2025
3.0.52 95 4/5/2025
3.0.51 114 4/5/2025
3.0.50 168 4/5/2025
3.0.49 116 4/5/2025
3.0.48 147 4/5/2025
3.0.47 119 4/5/2025
3.0.46 125 4/5/2025
3.0.45 120 4/5/2025
3.0.44 190 4/5/2025
3.0.43 129 4/5/2025
3.0.42 166 4/5/2025
3.0.41 103 4/5/2025
3.0.40 114 4/4/2025
3.0.39 133 4/4/2025
3.0.38 516 4/4/2025
3.0.37 249 4/4/2025
3.0.36 198 4/4/2025
3.0.35 196 4/4/2025
3.0.34 196 4/4/2025
3.0.33 353 4/3/2025
3.0.32 212 4/3/2025
3.0.31 199 4/1/2025
3.0.30 173 4/1/2025
3.0.29 323 4/1/2025
3.0.28 179 4/1/2025
3.0.27 189 4/1/2025
3.0.26 294 4/1/2025
3.0.25 320 4/1/2025
3.0.24 182 4/1/2025
3.0.23 267 4/1/2025
3.0.22 192 3/31/2025
3.0.21 175 3/31/2025
3.0.20 169 3/31/2025
3.0.19 181 3/31/2025
3.0.18 402 3/31/2025
3.0.17 251 3/29/2025
3.0.16 128 3/29/2025
3.0.15 157 3/29/2025
3.0.14 143 3/29/2025
3.0.13 135 3/29/2025
3.0.12 116 3/29/2025
3.0.11 368 3/27/2025
3.0.10 566 3/26/2025
3.0.9 475 3/26/2025
3.0.8 511 3/25/2025
3.0.7 570 3/25/2025
3.0.6 495 3/25/2025
3.0.5 493 3/25/2025
3.0.4 508 3/25/2025
3.0.3 500 3/25/2025
3.0.2 571 3/23/2025
3.0.1 160 3/21/2025