Soenneker.Extensions.Dtos.Email 3.0.135

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.135
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.135
                    
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.135" />
                    
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.135" />
                    
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.135
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.135"
                    
#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.135
                    
#: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.135
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.135
                    
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.219 31 9/28/2025
3.0.218 342 9/16/2025
3.0.217 190 9/10/2025
3.0.216 184 9/9/2025
3.0.215 149 9/9/2025
3.0.214 176 9/9/2025
3.0.213 226 9/4/2025
3.0.212 180 9/3/2025
3.0.211 184 9/3/2025
3.0.210 184 9/3/2025
3.0.209 164 9/3/2025
3.0.208 158 9/3/2025
3.0.207 158 9/3/2025
3.0.206 233 8/17/2025
3.0.205 135 8/17/2025
3.0.204 170 8/15/2025
3.0.203 157 8/15/2025
3.0.202 190 8/11/2025
3.0.201 201 8/11/2025
3.0.200 131 8/11/2025
3.0.199 144 8/11/2025
3.0.198 144 8/11/2025
3.0.197 245 8/11/2025
3.0.196 183 8/11/2025
3.0.195 155 8/11/2025
3.0.194 259 8/5/2025
3.0.193 254 8/5/2025
3.0.192 162 7/29/2025
3.0.191 104 7/29/2025
3.0.190 460 7/9/2025
3.0.189 178 7/9/2025
3.0.188 175 7/8/2025
3.0.187 294 6/28/2025
3.0.186 78 6/28/2025
3.0.185 125 6/28/2025
3.0.184 126 6/27/2025
3.0.183 76 6/27/2025
3.0.182 140 6/27/2025
3.0.181 210 6/25/2025
3.0.180 185 6/25/2025
3.0.179 188 6/24/2025
3.0.178 459 6/11/2025
3.0.177 325 6/11/2025
3.0.176 322 6/11/2025
3.0.175 357 6/11/2025
3.0.174 313 6/10/2025
3.0.173 406 6/3/2025
3.0.172 151 6/2/2025
3.0.171 226 6/2/2025
3.0.170 249 5/28/2025
3.0.169 159 5/28/2025
3.0.168 154 5/27/2025
3.0.167 283 5/27/2025
3.0.166 195 5/27/2025
3.0.165 156 5/27/2025
3.0.164 183 5/27/2025
3.0.163 158 5/27/2025
3.0.162 153 5/27/2025
3.0.161 262 5/25/2025
3.0.160 183 5/25/2025
3.0.159 273 5/23/2025
3.0.158 140 5/23/2025
3.0.157 134 5/23/2025
3.0.156 133 5/23/2025
3.0.155 138 5/23/2025
3.0.154 150 5/23/2025
3.0.153 155 5/22/2025
3.0.152 158 5/22/2025
3.0.151 616 5/14/2025
3.0.150 313 5/14/2025
3.0.149 253 5/14/2025
3.0.148 372 5/8/2025
3.0.147 158 5/8/2025
3.0.146 256 5/8/2025
3.0.145 170 5/8/2025
3.0.144 164 5/8/2025
3.0.143 173 5/8/2025
3.0.142 147 5/7/2025
3.0.141 171 5/7/2025
3.0.140 159 5/7/2025
3.0.139 425 5/6/2025
3.0.138 200 5/5/2025
3.0.137 187 5/5/2025
3.0.136 190 5/5/2025
3.0.135 172 5/5/2025
3.0.134 169 5/5/2025
3.0.133 195 5/5/2025
3.0.132 143 5/5/2025
3.0.131 151 5/5/2025
3.0.130 227 5/5/2025
3.0.129 157 5/5/2025
3.0.128 211 5/5/2025
3.0.126 215 5/5/2025
3.0.125 292 4/29/2025
3.0.124 263 4/27/2025
3.0.123 121 4/27/2025
3.0.122 201 4/26/2025
3.0.121 104 4/26/2025
3.0.120 489 4/9/2025
3.0.119 197 4/9/2025
3.0.118 184 4/9/2025
3.0.117 182 4/8/2025
3.0.116 182 4/8/2025
3.0.115 189 4/8/2025
3.0.114 189 4/8/2025
3.0.113 185 4/8/2025
3.0.112 184 4/8/2025
3.0.111 186 4/8/2025
3.0.110 181 4/8/2025
3.0.109 200 4/8/2025
3.0.108 184 4/8/2025
3.0.107 541 4/8/2025
3.0.106 159 4/8/2025
3.0.105 178 4/8/2025
3.0.104 204 4/8/2025
3.0.103 187 4/8/2025
3.0.102 183 4/8/2025
3.0.101 175 4/8/2025
3.0.100 176 4/8/2025
3.0.99 182 4/8/2025
3.0.98 178 4/8/2025
3.0.97 188 4/8/2025
3.0.96 170 4/8/2025
3.0.95 175 4/8/2025
3.0.94 167 4/7/2025
3.0.93 188 4/7/2025
3.0.92 176 4/7/2025
3.0.91 485 4/7/2025
3.0.90 180 4/7/2025
3.0.89 185 4/7/2025
3.0.88 257 4/7/2025
3.0.87 182 4/7/2025
3.0.86 194 4/7/2025
3.0.85 190 4/7/2025
3.0.84 175 4/7/2025
3.0.83 338 4/7/2025
3.0.82 179 4/7/2025
3.0.81 187 4/7/2025
3.0.80 178 4/7/2025
3.0.79 168 4/7/2025
3.0.78 276 4/7/2025
3.0.77 178 4/7/2025
3.0.76 173 4/7/2025
3.0.75 232 4/7/2025
3.0.74 182 4/7/2025
3.0.73 209 4/6/2025
3.0.72 186 4/6/2025
3.0.71 170 4/6/2025
3.0.70 196 4/6/2025
3.0.69 161 4/6/2025
3.0.68 170 4/6/2025
3.0.67 207 4/6/2025
3.0.66 144 4/6/2025
3.0.65 158 4/6/2025
3.0.64 161 4/6/2025
3.0.63 158 4/6/2025
3.0.62 147 4/6/2025
3.0.61 167 4/6/2025
3.0.60 173 4/6/2025
3.0.59 138 4/6/2025
3.0.58 135 4/6/2025
3.0.57 137 4/6/2025
3.0.56 142 4/6/2025
3.0.55 150 4/6/2025
3.0.54 128 4/6/2025
3.0.53 162 4/5/2025
3.0.52 95 4/5/2025
3.0.51 104 4/5/2025
3.0.50 150 4/5/2025
3.0.49 106 4/5/2025
3.0.48 132 4/5/2025
3.0.47 109 4/5/2025
3.0.46 113 4/5/2025
3.0.45 110 4/5/2025
3.0.44 171 4/5/2025
3.0.43 120 4/5/2025
3.0.42 150 4/5/2025
3.0.41 93 4/5/2025
3.0.40 114 4/4/2025
3.0.39 123 4/4/2025
3.0.38 497 4/4/2025
3.0.37 232 4/4/2025
3.0.36 182 4/4/2025
3.0.35 189 4/4/2025
3.0.34 191 4/4/2025
3.0.33 329 4/3/2025
3.0.32 200 4/3/2025
3.0.31 196 4/1/2025
3.0.30 155 4/1/2025
3.0.29 289 4/1/2025
3.0.28 178 4/1/2025
3.0.27 178 4/1/2025
3.0.26 269 4/1/2025
3.0.25 303 4/1/2025
3.0.24 180 4/1/2025
3.0.23 254 4/1/2025
3.0.22 181 3/31/2025
3.0.21 165 3/31/2025
3.0.20 169 3/31/2025
3.0.19 171 3/31/2025
3.0.18 361 3/31/2025
3.0.17 220 3/29/2025
3.0.16 115 3/29/2025
3.0.15 139 3/29/2025
3.0.14 127 3/29/2025
3.0.13 124 3/29/2025
3.0.12 106 3/29/2025
3.0.11 336 3/27/2025
3.0.10 554 3/26/2025
3.0.9 475 3/26/2025
3.0.8 495 3/25/2025
3.0.7 552 3/25/2025
3.0.6 484 3/25/2025
3.0.5 483 3/25/2025
3.0.4 498 3/25/2025
3.0.3 491 3/25/2025
3.0.2 524 3/23/2025
3.0.1 147 3/21/2025