Soenneker.Extensions.Dtos.Email 3.0.196

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.196
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.196
                    
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.196" />
                    
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.196" />
                    
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.196
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.196"
                    
#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.196
                    
#: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.196
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.196
                    
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 11 8/17/2025
3.0.205 10 8/17/2025
3.0.204 83 8/15/2025
3.0.203 84 8/15/2025
3.0.202 95 8/11/2025
3.0.201 91 8/11/2025
3.0.200 85 8/11/2025
3.0.199 87 8/11/2025
3.0.198 89 8/11/2025
3.0.197 87 8/11/2025
3.0.196 89 8/11/2025
3.0.195 86 8/11/2025
3.0.194 221 8/5/2025
3.0.193 218 8/5/2025
3.0.192 124 7/29/2025
3.0.191 92 7/29/2025
3.0.190 204 7/9/2025
3.0.189 154 7/9/2025
3.0.188 151 7/8/2025
3.0.187 233 6/28/2025
3.0.186 62 6/28/2025
3.0.185 101 6/28/2025
3.0.184 94 6/27/2025
3.0.183 59 6/27/2025
3.0.182 100 6/27/2025
3.0.181 177 6/25/2025
3.0.180 159 6/25/2025
3.0.179 157 6/24/2025
3.0.178 410 6/11/2025
3.0.177 304 6/11/2025
3.0.176 298 6/11/2025
3.0.175 321 6/11/2025
3.0.174 304 6/10/2025
3.0.173 330 6/3/2025
3.0.172 135 6/2/2025
3.0.171 201 6/2/2025
3.0.170 211 5/28/2025
3.0.169 140 5/28/2025
3.0.168 138 5/27/2025
3.0.167 232 5/27/2025
3.0.166 170 5/27/2025
3.0.165 144 5/27/2025
3.0.164 156 5/27/2025
3.0.163 140 5/27/2025
3.0.162 137 5/27/2025
3.0.161 217 5/25/2025
3.0.160 144 5/25/2025
3.0.159 216 5/23/2025
3.0.158 121 5/23/2025
3.0.157 118 5/23/2025
3.0.156 118 5/23/2025
3.0.155 123 5/23/2025
3.0.154 134 5/23/2025
3.0.153 139 5/22/2025
3.0.152 135 5/22/2025
3.0.151 506 5/14/2025
3.0.150 280 5/14/2025
3.0.149 230 5/14/2025
3.0.148 311 5/8/2025
3.0.147 141 5/8/2025
3.0.146 215 5/8/2025
3.0.145 147 5/8/2025
3.0.144 149 5/8/2025
3.0.143 144 5/8/2025
3.0.142 142 5/7/2025
3.0.141 150 5/7/2025
3.0.140 143 5/7/2025
3.0.139 350 5/6/2025
3.0.138 164 5/5/2025
3.0.137 161 5/5/2025
3.0.136 168 5/5/2025
3.0.135 159 5/5/2025
3.0.134 144 5/5/2025
3.0.133 168 5/5/2025
3.0.132 136 5/5/2025
3.0.131 134 5/5/2025
3.0.130 197 5/5/2025
3.0.129 141 5/5/2025
3.0.128 173 5/5/2025
3.0.126 178 5/5/2025
3.0.125 256 4/29/2025
3.0.124 216 4/27/2025
3.0.123 99 4/27/2025
3.0.122 163 4/26/2025
3.0.121 77 4/26/2025
3.0.120 428 4/9/2025
3.0.119 172 4/9/2025
3.0.118 167 4/9/2025
3.0.117 169 4/8/2025
3.0.116 174 4/8/2025
3.0.115 163 4/8/2025
3.0.114 164 4/8/2025
3.0.113 168 4/8/2025
3.0.112 159 4/8/2025
3.0.111 170 4/8/2025
3.0.110 164 4/8/2025
3.0.109 178 4/8/2025
3.0.108 162 4/8/2025
3.0.107 436 4/8/2025
3.0.106 149 4/8/2025
3.0.105 155 4/8/2025
3.0.104 177 4/8/2025
3.0.103 167 4/8/2025
3.0.102 167 4/8/2025
3.0.101 157 4/8/2025
3.0.100 159 4/8/2025
3.0.99 160 4/8/2025
3.0.98 161 4/8/2025
3.0.97 167 4/8/2025
3.0.96 152 4/8/2025
3.0.95 161 4/8/2025
3.0.94 150 4/7/2025
3.0.93 166 4/7/2025
3.0.92 161 4/7/2025
3.0.91 388 4/7/2025
3.0.90 160 4/7/2025
3.0.89 161 4/7/2025
3.0.88 215 4/7/2025
3.0.87 158 4/7/2025
3.0.86 166 4/7/2025
3.0.85 175 4/7/2025
3.0.84 158 4/7/2025
3.0.83 275 4/7/2025
3.0.82 162 4/7/2025
3.0.81 165 4/7/2025
3.0.80 162 4/7/2025
3.0.79 160 4/7/2025
3.0.78 235 4/7/2025
3.0.77 161 4/7/2025
3.0.76 163 4/7/2025
3.0.75 200 4/7/2025
3.0.74 166 4/7/2025
3.0.73 187 4/6/2025
3.0.72 163 4/6/2025
3.0.71 154 4/6/2025
3.0.70 168 4/6/2025
3.0.69 156 4/6/2025
3.0.68 153 4/6/2025
3.0.67 179 4/6/2025
3.0.66 134 4/6/2025
3.0.65 150 4/6/2025
3.0.64 143 4/6/2025
3.0.63 140 4/6/2025
3.0.62 130 4/6/2025
3.0.61 144 4/6/2025
3.0.60 146 4/6/2025
3.0.59 118 4/6/2025
3.0.58 111 4/6/2025
3.0.57 114 4/6/2025
3.0.56 130 4/6/2025
3.0.55 125 4/6/2025
3.0.54 113 4/6/2025
3.0.53 135 4/5/2025
3.0.52 88 4/5/2025
3.0.51 97 4/5/2025
3.0.50 126 4/5/2025
3.0.49 96 4/5/2025
3.0.48 109 4/5/2025
3.0.47 93 4/5/2025
3.0.46 98 4/5/2025
3.0.45 92 4/5/2025
3.0.44 147 4/5/2025
3.0.43 100 4/5/2025
3.0.42 122 4/5/2025
3.0.41 86 4/5/2025
3.0.40 92 4/4/2025
3.0.39 115 4/4/2025
3.0.38 407 4/4/2025
3.0.37 210 4/4/2025
3.0.36 161 4/4/2025
3.0.35 168 4/4/2025
3.0.34 170 4/4/2025
3.0.33 271 4/3/2025
3.0.32 172 4/3/2025
3.0.31 184 4/1/2025
3.0.30 148 4/1/2025
3.0.29 231 4/1/2025
3.0.28 151 4/1/2025
3.0.27 147 4/1/2025
3.0.26 228 4/1/2025
3.0.25 260 4/1/2025
3.0.24 158 4/1/2025
3.0.23 217 4/1/2025
3.0.22 159 3/31/2025
3.0.21 149 3/31/2025
3.0.20 153 3/31/2025
3.0.19 154 3/31/2025
3.0.18 306 3/31/2025
3.0.17 178 3/29/2025
3.0.16 97 3/29/2025
3.0.15 118 3/29/2025
3.0.14 104 3/29/2025
3.0.13 100 3/29/2025
3.0.12 90 3/29/2025
3.0.11 272 3/27/2025
3.0.10 523 3/26/2025
3.0.9 468 3/26/2025
3.0.8 485 3/25/2025
3.0.7 514 3/25/2025
3.0.6 471 3/25/2025
3.0.5 468 3/25/2025
3.0.4 480 3/25/2025
3.0.3 475 3/25/2025
3.0.2 437 3/23/2025
3.0.1 124 3/21/2025