Soenneker.Extensions.Dtos.Email 3.0.35

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.35
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.35
                    
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.35" />
                    
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.35" />
                    
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.35
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.35"
                    
#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.35
                    
#: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.35
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.35
                    
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.190 157 7/9/2025
3.0.189 124 7/9/2025
3.0.188 134 7/8/2025
3.0.187 226 6/28/2025
3.0.186 57 6/28/2025
3.0.185 97 6/28/2025
3.0.184 91 6/27/2025
3.0.183 55 6/27/2025
3.0.182 92 6/27/2025
3.0.181 170 6/25/2025
3.0.180 154 6/25/2025
3.0.179 153 6/24/2025
3.0.178 403 6/11/2025
3.0.177 297 6/11/2025
3.0.176 290 6/11/2025
3.0.175 315 6/11/2025
3.0.174 298 6/10/2025
3.0.173 321 6/3/2025
3.0.172 130 6/2/2025
3.0.171 194 6/2/2025
3.0.170 205 5/28/2025
3.0.169 134 5/28/2025
3.0.168 134 5/27/2025
3.0.167 226 5/27/2025
3.0.166 164 5/27/2025
3.0.165 137 5/27/2025
3.0.164 151 5/27/2025
3.0.163 136 5/27/2025
3.0.162 133 5/27/2025
3.0.161 212 5/25/2025
3.0.160 139 5/25/2025
3.0.159 211 5/23/2025
3.0.158 116 5/23/2025
3.0.157 113 5/23/2025
3.0.156 112 5/23/2025
3.0.155 118 5/23/2025
3.0.154 129 5/23/2025
3.0.153 136 5/22/2025
3.0.152 130 5/22/2025
3.0.151 500 5/14/2025
3.0.150 276 5/14/2025
3.0.149 222 5/14/2025
3.0.148 307 5/8/2025
3.0.147 136 5/8/2025
3.0.146 209 5/8/2025
3.0.145 141 5/8/2025
3.0.144 142 5/8/2025
3.0.143 139 5/8/2025
3.0.142 136 5/7/2025
3.0.141 140 5/7/2025
3.0.140 138 5/7/2025
3.0.139 343 5/6/2025
3.0.138 159 5/5/2025
3.0.137 154 5/5/2025
3.0.136 164 5/5/2025
3.0.135 154 5/5/2025
3.0.134 139 5/5/2025
3.0.133 164 5/5/2025
3.0.132 131 5/5/2025
3.0.131 130 5/5/2025
3.0.130 190 5/5/2025
3.0.129 135 5/5/2025
3.0.128 167 5/5/2025
3.0.126 172 5/5/2025
3.0.125 250 4/29/2025
3.0.124 211 4/27/2025
3.0.123 95 4/27/2025
3.0.122 158 4/26/2025
3.0.121 73 4/26/2025
3.0.120 424 4/9/2025
3.0.119 168 4/9/2025
3.0.118 163 4/9/2025
3.0.117 164 4/8/2025
3.0.116 171 4/8/2025
3.0.115 156 4/8/2025
3.0.114 154 4/8/2025
3.0.113 161 4/8/2025
3.0.112 154 4/8/2025
3.0.111 164 4/8/2025
3.0.110 160 4/8/2025
3.0.109 172 4/8/2025
3.0.108 154 4/8/2025
3.0.107 427 4/8/2025
3.0.106 144 4/8/2025
3.0.105 147 4/8/2025
3.0.104 171 4/8/2025
3.0.103 160 4/8/2025
3.0.102 160 4/8/2025
3.0.101 153 4/8/2025
3.0.100 154 4/8/2025
3.0.99 153 4/8/2025
3.0.98 155 4/8/2025
3.0.97 161 4/8/2025
3.0.96 147 4/8/2025
3.0.95 156 4/8/2025
3.0.94 146 4/7/2025
3.0.93 161 4/7/2025
3.0.92 151 4/7/2025
3.0.91 382 4/7/2025
3.0.90 155 4/7/2025
3.0.89 154 4/7/2025
3.0.88 208 4/7/2025
3.0.87 152 4/7/2025
3.0.86 159 4/7/2025
3.0.85 170 4/7/2025
3.0.84 152 4/7/2025
3.0.83 269 4/7/2025
3.0.82 157 4/7/2025
3.0.81 158 4/7/2025
3.0.80 156 4/7/2025
3.0.79 154 4/7/2025
3.0.78 229 4/7/2025
3.0.77 154 4/7/2025
3.0.76 158 4/7/2025
3.0.75 195 4/7/2025
3.0.74 160 4/7/2025
3.0.73 183 4/6/2025
3.0.72 155 4/6/2025
3.0.71 151 4/6/2025
3.0.70 163 4/6/2025
3.0.69 151 4/6/2025
3.0.68 149 4/6/2025
3.0.67 171 4/6/2025
3.0.66 129 4/6/2025
3.0.65 144 4/6/2025
3.0.64 136 4/6/2025
3.0.63 132 4/6/2025
3.0.62 125 4/6/2025
3.0.61 136 4/6/2025
3.0.60 141 4/6/2025
3.0.59 113 4/6/2025
3.0.58 104 4/6/2025
3.0.57 106 4/6/2025
3.0.56 125 4/6/2025
3.0.55 118 4/6/2025
3.0.54 107 4/6/2025
3.0.53 130 4/5/2025
3.0.52 82 4/5/2025
3.0.51 91 4/5/2025
3.0.50 120 4/5/2025
3.0.49 90 4/5/2025
3.0.48 105 4/5/2025
3.0.47 87 4/5/2025
3.0.46 92 4/5/2025
3.0.45 87 4/5/2025
3.0.44 141 4/5/2025
3.0.43 95 4/5/2025
3.0.42 116 4/5/2025
3.0.41 82 4/5/2025
3.0.40 87 4/4/2025
3.0.39 110 4/4/2025
3.0.38 394 4/4/2025
3.0.37 206 4/4/2025
3.0.36 155 4/4/2025
3.0.35 162 4/4/2025
3.0.34 165 4/4/2025
3.0.33 263 4/3/2025
3.0.32 164 4/3/2025
3.0.31 179 4/1/2025
3.0.30 143 4/1/2025
3.0.29 224 4/1/2025
3.0.28 145 4/1/2025
3.0.27 140 4/1/2025
3.0.26 223 4/1/2025
3.0.25 255 4/1/2025
3.0.24 151 4/1/2025
3.0.23 211 4/1/2025
3.0.22 152 3/31/2025
3.0.21 144 3/31/2025
3.0.20 149 3/31/2025
3.0.19 150 3/31/2025
3.0.18 299 3/31/2025
3.0.17 173 3/29/2025
3.0.16 92 3/29/2025
3.0.15 111 3/29/2025
3.0.14 99 3/29/2025
3.0.13 92 3/29/2025
3.0.12 86 3/29/2025
3.0.11 265 3/27/2025
3.0.10 518 3/26/2025
3.0.9 463 3/26/2025
3.0.8 480 3/25/2025
3.0.7 507 3/25/2025
3.0.6 463 3/25/2025
3.0.5 464 3/25/2025
3.0.4 476 3/25/2025
3.0.3 469 3/25/2025
3.0.2 431 3/23/2025
3.0.1 120 3/21/2025