Soenneker.Extensions.Dtos.Email 3.0.220

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.220
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.220
                    
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.220" />
                    
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.220" />
                    
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.220
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.220"
                    
#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.220
                    
#: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.220
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.220
                    
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 198 9/30/2025
3.0.220 189 9/30/2025
3.0.219 171 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 173 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 178 8/15/2025
3.0.202 212 8/11/2025
3.0.201 228 8/11/2025
3.0.200 132 8/11/2025
3.0.199 144 8/11/2025
3.0.198 158 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 155 6/28/2025
3.0.184 152 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 206 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 469 6/3/2025
3.0.172 161 6/2/2025
3.0.171 255 6/2/2025
3.0.170 264 5/28/2025
3.0.169 172 5/28/2025
3.0.168 164 5/27/2025
3.0.167 318 5/27/2025
3.0.166 201 5/27/2025
3.0.165 159 5/27/2025
3.0.164 187 5/27/2025
3.0.163 158 5/27/2025
3.0.162 163 5/27/2025
3.0.161 311 5/25/2025
3.0.160 210 5/25/2025
3.0.159 322 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 168 5/22/2025
3.0.152 174 5/22/2025
3.0.151 726 5/14/2025
3.0.150 336 5/14/2025
3.0.149 268 5/14/2025
3.0.148 426 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 177 5/8/2025
3.0.143 186 5/8/2025
3.0.142 157 5/7/2025
3.0.141 182 5/7/2025
3.0.140 169 5/7/2025
3.0.139 499 5/6/2025
3.0.138 216 5/5/2025
3.0.137 202 5/5/2025
3.0.136 208 5/5/2025
3.0.135 189 5/5/2025
3.0.134 179 5/5/2025
3.0.133 215 5/5/2025
3.0.132 154 5/5/2025
3.0.131 161 5/5/2025
3.0.130 251 5/5/2025
3.0.129 167 5/5/2025
3.0.128 235 5/5/2025
3.0.126 235 5/5/2025
3.0.125 334 4/29/2025
3.0.124 303 4/27/2025
3.0.123 137 4/27/2025
3.0.122 240 4/26/2025
3.0.121 116 4/26/2025
3.0.120 533 4/9/2025
3.0.119 207 4/9/2025
3.0.118 194 4/9/2025
3.0.117 197 4/8/2025
3.0.116 192 4/8/2025
3.0.115 205 4/8/2025
3.0.114 202 4/8/2025
3.0.113 195 4/8/2025
3.0.112 205 4/8/2025
3.0.111 196 4/8/2025
3.0.110 194 4/8/2025
3.0.109 221 4/8/2025
3.0.108 185 4/8/2025
3.0.107 646 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 197 4/8/2025
3.0.101 175 4/8/2025
3.0.100 186 4/8/2025
3.0.99 194 4/8/2025
3.0.98 189 4/8/2025
3.0.97 206 4/8/2025
3.0.96 180 4/8/2025
3.0.95 186 4/8/2025
3.0.94 177 4/7/2025
3.0.93 207 4/7/2025
3.0.92 186 4/7/2025
3.0.91 567 4/7/2025
3.0.90 201 4/7/2025
3.0.89 195 4/7/2025
3.0.88 294 4/7/2025
3.0.87 194 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 388 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 307 4/7/2025
3.0.77 189 4/7/2025
3.0.76 185 4/7/2025
3.0.75 252 4/7/2025
3.0.74 200 4/7/2025
3.0.73 220 4/6/2025
3.0.72 200 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 172 4/6/2025
3.0.67 230 4/6/2025
3.0.66 147 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 158 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 139 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 169 4/5/2025
3.0.49 117 4/5/2025
3.0.48 154 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 191 4/5/2025
3.0.43 130 4/5/2025
3.0.42 167 4/5/2025
3.0.41 103 4/5/2025
3.0.40 115 4/4/2025
3.0.39 140 4/4/2025
3.0.38 580 4/4/2025
3.0.37 255 4/4/2025
3.0.36 198 4/4/2025
3.0.35 197 4/4/2025
3.0.34 196 4/4/2025
3.0.33 369 4/3/2025
3.0.32 213 4/3/2025
3.0.31 202 4/1/2025
3.0.30 173 4/1/2025
3.0.29 333 4/1/2025
3.0.28 180 4/1/2025
3.0.27 191 4/1/2025
3.0.26 311 4/1/2025
3.0.25 335 4/1/2025
3.0.24 183 4/1/2025
3.0.23 274 4/1/2025
3.0.22 193 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 424 3/31/2025
3.0.17 260 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 397 3/27/2025
3.0.10 575 3/26/2025
3.0.9 475 3/26/2025
3.0.8 512 3/25/2025
3.0.7 581 3/25/2025
3.0.6 496 3/25/2025
3.0.5 493 3/25/2025
3.0.4 508 3/25/2025
3.0.3 502 3/25/2025
3.0.2 600 3/23/2025
3.0.1 163 3/21/2025