Soenneker.Extensions.Dtos.Email 3.0.199

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.199
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.199
                    
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.199" />
                    
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.199" />
                    
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.199
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.199"
                    
#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.199
                    
#: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.199
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.199
                    
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.206 131 8/17/2025
3.0.205 110 8/17/2025
3.0.204 144 8/15/2025
3.0.203 142 8/15/2025
3.0.202 155 8/11/2025
3.0.201 168 8/11/2025
3.0.200 119 8/11/2025
3.0.199 123 8/11/2025
3.0.198 123 8/11/2025
3.0.197 190 8/11/2025
3.0.196 150 8/11/2025
3.0.195 129 8/11/2025
3.0.194 239 8/5/2025
3.0.193 231 8/5/2025
3.0.192 129 7/29/2025
3.0.191 97 7/29/2025
3.0.190 232 7/9/2025
3.0.189 159 7/9/2025
3.0.188 156 7/8/2025
3.0.187 237 6/28/2025
3.0.186 66 6/28/2025
3.0.185 105 6/28/2025
3.0.184 98 6/27/2025
3.0.183 64 6/27/2025
3.0.182 105 6/27/2025
3.0.181 181 6/25/2025
3.0.180 164 6/25/2025
3.0.179 161 6/24/2025
3.0.178 417 6/11/2025
3.0.177 308 6/11/2025
3.0.176 302 6/11/2025
3.0.175 326 6/11/2025
3.0.174 308 6/10/2025
3.0.173 334 6/3/2025
3.0.172 139 6/2/2025
3.0.171 205 6/2/2025
3.0.170 215 5/28/2025
3.0.169 145 5/28/2025
3.0.168 142 5/27/2025
3.0.167 237 5/27/2025
3.0.166 175 5/27/2025
3.0.165 148 5/27/2025
3.0.164 160 5/27/2025
3.0.163 145 5/27/2025
3.0.162 141 5/27/2025
3.0.161 221 5/25/2025
3.0.160 150 5/25/2025
3.0.159 220 5/23/2025
3.0.158 125 5/23/2025
3.0.157 122 5/23/2025
3.0.156 122 5/23/2025
3.0.155 127 5/23/2025
3.0.154 138 5/23/2025
3.0.153 144 5/22/2025
3.0.152 139 5/22/2025
3.0.151 510 5/14/2025
3.0.150 285 5/14/2025
3.0.149 236 5/14/2025
3.0.148 315 5/8/2025
3.0.147 145 5/8/2025
3.0.146 220 5/8/2025
3.0.145 151 5/8/2025
3.0.144 153 5/8/2025
3.0.143 149 5/8/2025
3.0.142 146 5/7/2025
3.0.141 155 5/7/2025
3.0.140 147 5/7/2025
3.0.139 355 5/6/2025
3.0.138 170 5/5/2025
3.0.137 167 5/5/2025
3.0.136 172 5/5/2025
3.0.135 164 5/5/2025
3.0.134 149 5/5/2025
3.0.133 173 5/5/2025
3.0.132 141 5/5/2025
3.0.131 139 5/5/2025
3.0.130 201 5/5/2025
3.0.129 145 5/5/2025
3.0.128 180 5/5/2025
3.0.126 183 5/5/2025
3.0.125 260 4/29/2025
3.0.124 221 4/27/2025
3.0.123 103 4/27/2025
3.0.122 170 4/26/2025
3.0.121 84 4/26/2025
3.0.120 438 4/9/2025
3.0.119 177 4/9/2025
3.0.118 172 4/9/2025
3.0.117 174 4/8/2025
3.0.116 179 4/8/2025
3.0.115 169 4/8/2025
3.0.114 168 4/8/2025
3.0.113 173 4/8/2025
3.0.112 164 4/8/2025
3.0.111 174 4/8/2025
3.0.110 169 4/8/2025
3.0.109 182 4/8/2025
3.0.108 167 4/8/2025
3.0.107 441 4/8/2025
3.0.106 155 4/8/2025
3.0.105 162 4/8/2025
3.0.104 183 4/8/2025
3.0.103 171 4/8/2025
3.0.102 171 4/8/2025
3.0.101 161 4/8/2025
3.0.100 164 4/8/2025
3.0.99 164 4/8/2025
3.0.98 167 4/8/2025
3.0.97 172 4/8/2025
3.0.96 157 4/8/2025
3.0.95 166 4/8/2025
3.0.94 155 4/7/2025
3.0.93 171 4/7/2025
3.0.92 167 4/7/2025
3.0.91 392 4/7/2025
3.0.90 165 4/7/2025
3.0.89 166 4/7/2025
3.0.88 220 4/7/2025
3.0.87 163 4/7/2025
3.0.86 173 4/7/2025
3.0.85 180 4/7/2025
3.0.84 163 4/7/2025
3.0.83 280 4/7/2025
3.0.82 167 4/7/2025
3.0.81 170 4/7/2025
3.0.80 167 4/7/2025
3.0.79 167 4/7/2025
3.0.78 240 4/7/2025
3.0.77 166 4/7/2025
3.0.76 167 4/7/2025
3.0.75 205 4/7/2025
3.0.74 170 4/7/2025
3.0.73 191 4/6/2025
3.0.72 169 4/6/2025
3.0.71 158 4/6/2025
3.0.70 174 4/6/2025
3.0.69 160 4/6/2025
3.0.68 158 4/6/2025
3.0.67 184 4/6/2025
3.0.66 139 4/6/2025
3.0.65 156 4/6/2025
3.0.64 148 4/6/2025
3.0.63 146 4/6/2025
3.0.62 135 4/6/2025
3.0.61 149 4/6/2025
3.0.60 152 4/6/2025
3.0.59 125 4/6/2025
3.0.58 117 4/6/2025
3.0.57 119 4/6/2025
3.0.56 135 4/6/2025
3.0.55 130 4/6/2025
3.0.54 117 4/6/2025
3.0.53 140 4/5/2025
3.0.52 94 4/5/2025
3.0.51 102 4/5/2025
3.0.50 131 4/5/2025
3.0.49 100 4/5/2025
3.0.48 115 4/5/2025
3.0.47 97 4/5/2025
3.0.46 103 4/5/2025
3.0.45 97 4/5/2025
3.0.44 153 4/5/2025
3.0.43 107 4/5/2025
3.0.42 126 4/5/2025
3.0.41 91 4/5/2025
3.0.40 98 4/4/2025
3.0.39 121 4/4/2025
3.0.38 412 4/4/2025
3.0.37 215 4/4/2025
3.0.36 165 4/4/2025
3.0.35 174 4/4/2025
3.0.34 174 4/4/2025
3.0.33 275 4/3/2025
3.0.32 177 4/3/2025
3.0.31 189 4/1/2025
3.0.30 152 4/1/2025
3.0.29 235 4/1/2025
3.0.28 158 4/1/2025
3.0.27 155 4/1/2025
3.0.26 233 4/1/2025
3.0.25 264 4/1/2025
3.0.24 164 4/1/2025
3.0.23 222 4/1/2025
3.0.22 163 3/31/2025
3.0.21 153 3/31/2025
3.0.20 157 3/31/2025
3.0.19 159 3/31/2025
3.0.18 310 3/31/2025
3.0.17 183 3/29/2025
3.0.16 101 3/29/2025
3.0.15 125 3/29/2025
3.0.14 109 3/29/2025
3.0.13 105 3/29/2025
3.0.12 94 3/29/2025
3.0.11 277 3/27/2025
3.0.10 527 3/26/2025
3.0.9 473 3/26/2025
3.0.8 489 3/25/2025
3.0.7 521 3/25/2025
3.0.6 476 3/25/2025
3.0.5 472 3/25/2025
3.0.4 485 3/25/2025
3.0.3 479 3/25/2025
3.0.2 443 3/23/2025
3.0.1 128 3/21/2025