Soenneker.Extensions.Dtos.Email 3.0.93

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.93
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.93
                    
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.93" />
                    
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.93" />
                    
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.93
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.93"
                    
#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.
#addin nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.93
                    
Install Soenneker.Extensions.Dtos.Email as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.93
                    
Install Soenneker.Extensions.Dtos.Email 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.178 380 6/11/2025
3.0.177 293 6/11/2025
3.0.176 278 6/11/2025
3.0.175 309 6/11/2025
3.0.174 294 6/10/2025
3.0.173 314 6/3/2025
3.0.172 127 6/2/2025
3.0.171 186 6/2/2025
3.0.170 199 5/28/2025
3.0.169 129 5/28/2025
3.0.168 132 5/27/2025
3.0.167 223 5/27/2025
3.0.166 161 5/27/2025
3.0.165 129 5/27/2025
3.0.164 145 5/27/2025
3.0.163 133 5/27/2025
3.0.162 131 5/27/2025
3.0.161 209 5/25/2025
3.0.160 131 5/25/2025
3.0.159 205 5/23/2025
3.0.158 112 5/23/2025
3.0.157 109 5/23/2025
3.0.156 107 5/23/2025
3.0.155 115 5/23/2025
3.0.154 125 5/23/2025
3.0.153 132 5/22/2025
3.0.152 127 5/22/2025
3.0.151 491 5/14/2025
3.0.150 273 5/14/2025
3.0.149 218 5/14/2025
3.0.148 303 5/8/2025
3.0.147 133 5/8/2025
3.0.146 205 5/8/2025
3.0.145 134 5/8/2025
3.0.144 138 5/8/2025
3.0.143 133 5/8/2025
3.0.142 133 5/7/2025
3.0.141 131 5/7/2025
3.0.140 135 5/7/2025
3.0.139 340 5/6/2025
3.0.138 152 5/5/2025
3.0.137 146 5/5/2025
3.0.136 158 5/5/2025
3.0.135 152 5/5/2025
3.0.134 134 5/5/2025
3.0.133 156 5/5/2025
3.0.132 127 5/5/2025
3.0.131 126 5/5/2025
3.0.130 186 5/5/2025
3.0.129 131 5/5/2025
3.0.128 162 5/5/2025
3.0.126 167 5/5/2025
3.0.125 246 4/29/2025
3.0.124 208 4/27/2025
3.0.123 93 4/27/2025
3.0.122 152 4/26/2025
3.0.121 66 4/26/2025
3.0.120 421 4/9/2025
3.0.119 161 4/9/2025
3.0.118 158 4/9/2025
3.0.117 155 4/8/2025
3.0.116 167 4/8/2025
3.0.115 149 4/8/2025
3.0.114 148 4/8/2025
3.0.113 154 4/8/2025
3.0.112 146 4/8/2025
3.0.111 158 4/8/2025
3.0.110 153 4/8/2025
3.0.109 163 4/8/2025
3.0.108 148 4/8/2025
3.0.107 420 4/8/2025
3.0.106 140 4/8/2025
3.0.105 142 4/8/2025
3.0.104 164 4/8/2025
3.0.103 152 4/8/2025
3.0.102 156 4/8/2025
3.0.101 148 4/8/2025
3.0.100 151 4/8/2025
3.0.99 147 4/8/2025
3.0.98 144 4/8/2025
3.0.97 154 4/8/2025
3.0.96 144 4/8/2025
3.0.95 149 4/8/2025
3.0.94 142 4/7/2025
3.0.93 153 4/7/2025
3.0.92 144 4/7/2025
3.0.91 376 4/7/2025
3.0.90 148 4/7/2025
3.0.89 147 4/7/2025
3.0.88 203 4/7/2025
3.0.87 147 4/7/2025
3.0.86 149 4/7/2025
3.0.85 161 4/7/2025
3.0.84 147 4/7/2025
3.0.83 266 4/7/2025
3.0.82 151 4/7/2025
3.0.81 150 4/7/2025
3.0.80 153 4/7/2025
3.0.79 148 4/7/2025
3.0.78 221 4/7/2025
3.0.77 148 4/7/2025
3.0.76 152 4/7/2025
3.0.75 189 4/7/2025
3.0.74 155 4/7/2025
3.0.73 177 4/6/2025
3.0.72 147 4/6/2025
3.0.71 147 4/6/2025
3.0.70 156 4/6/2025
3.0.69 146 4/6/2025
3.0.68 143 4/6/2025
3.0.67 164 4/6/2025
3.0.66 122 4/6/2025
3.0.65 140 4/6/2025
3.0.64 132 4/6/2025
3.0.63 128 4/6/2025
3.0.62 121 4/6/2025
3.0.61 129 4/6/2025
3.0.60 136 4/6/2025
3.0.59 106 4/6/2025
3.0.58 99 4/6/2025
3.0.57 101 4/6/2025
3.0.56 121 4/6/2025
3.0.55 112 4/6/2025
3.0.54 104 4/6/2025
3.0.53 127 4/5/2025
3.0.52 79 4/5/2025
3.0.51 87 4/5/2025
3.0.50 114 4/5/2025
3.0.49 84 4/5/2025
3.0.48 98 4/5/2025
3.0.47 81 4/5/2025
3.0.46 85 4/5/2025
3.0.45 84 4/5/2025
3.0.44 133 4/5/2025
3.0.43 90 4/5/2025
3.0.42 107 4/5/2025
3.0.41 80 4/5/2025
3.0.40 83 4/4/2025
3.0.39 105 4/4/2025
3.0.38 390 4/4/2025
3.0.37 203 4/4/2025
3.0.36 152 4/4/2025
3.0.35 154 4/4/2025
3.0.34 162 4/4/2025
3.0.33 255 4/3/2025
3.0.32 158 4/3/2025
3.0.31 175 4/1/2025
3.0.30 139 4/1/2025
3.0.29 215 4/1/2025
3.0.28 139 4/1/2025
3.0.27 137 4/1/2025
3.0.26 220 4/1/2025
3.0.25 249 4/1/2025
3.0.24 143 4/1/2025
3.0.23 204 4/1/2025
3.0.22 142 3/31/2025
3.0.21 138 3/31/2025
3.0.20 145 3/31/2025
3.0.19 147 3/31/2025
3.0.18 293 3/31/2025
3.0.17 170 3/29/2025
3.0.16 88 3/29/2025
3.0.15 100 3/29/2025
3.0.14 95 3/29/2025
3.0.13 86 3/29/2025
3.0.12 82 3/29/2025
3.0.11 258 3/27/2025
3.0.10 515 3/26/2025
3.0.9 461 3/26/2025
3.0.8 476 3/25/2025
3.0.7 500 3/25/2025
3.0.6 459 3/25/2025
3.0.5 459 3/25/2025
3.0.4 470 3/25/2025
3.0.3 465 3/25/2025
3.0.2 424 3/23/2025
3.0.1 116 3/21/2025