Soenneker.Extensions.Dtos.Email 3.0.131

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.131
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.131
                    
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.131" />
                    
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.131" />
                    
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.131
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.131"
                    
#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.131
                    
Install Soenneker.Extensions.Dtos.Email as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.131
                    
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 379 6/11/2025
3.0.177 292 6/11/2025
3.0.176 277 6/11/2025
3.0.175 308 6/11/2025
3.0.174 293 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 124 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 216 5/14/2025
3.0.148 301 5/8/2025
3.0.147 131 5/8/2025
3.0.146 205 5/8/2025
3.0.145 134 5/8/2025
3.0.144 136 5/8/2025
3.0.143 132 5/8/2025
3.0.142 133 5/7/2025
3.0.141 131 5/7/2025
3.0.140 132 5/7/2025
3.0.139 337 5/6/2025
3.0.138 151 5/5/2025
3.0.137 142 5/5/2025
3.0.136 158 5/5/2025
3.0.135 152 5/5/2025
3.0.134 131 5/5/2025
3.0.133 156 5/5/2025
3.0.132 126 5/5/2025
3.0.131 126 5/5/2025
3.0.130 184 5/5/2025
3.0.129 131 5/5/2025
3.0.128 162 5/5/2025
3.0.126 166 5/5/2025
3.0.125 244 4/29/2025
3.0.124 206 4/27/2025
3.0.123 93 4/27/2025
3.0.122 152 4/26/2025
3.0.121 64 4/26/2025
3.0.120 421 4/9/2025
3.0.119 161 4/9/2025
3.0.118 157 4/9/2025
3.0.117 153 4/8/2025
3.0.116 166 4/8/2025
3.0.115 148 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 155 4/8/2025
3.0.110 152 4/8/2025
3.0.109 163 4/8/2025
3.0.108 147 4/8/2025
3.0.107 420 4/8/2025
3.0.106 140 4/8/2025
3.0.105 140 4/8/2025
3.0.104 163 4/8/2025
3.0.103 149 4/8/2025
3.0.102 155 4/8/2025
3.0.101 147 4/8/2025
3.0.100 151 4/8/2025
3.0.99 147 4/8/2025
3.0.98 143 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 139 4/7/2025
3.0.93 153 4/7/2025
3.0.92 143 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 202 4/7/2025
3.0.87 144 4/7/2025
3.0.86 147 4/7/2025
3.0.85 156 4/7/2025
3.0.84 147 4/7/2025
3.0.83 266 4/7/2025
3.0.82 149 4/7/2025
3.0.81 150 4/7/2025
3.0.80 150 4/7/2025
3.0.79 148 4/7/2025
3.0.78 219 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 153 4/7/2025
3.0.73 177 4/6/2025
3.0.72 146 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 142 4/6/2025
3.0.67 161 4/6/2025
3.0.66 119 4/6/2025
3.0.65 139 4/6/2025
3.0.64 128 4/6/2025
3.0.63 128 4/6/2025
3.0.62 120 4/6/2025
3.0.61 128 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 110 4/6/2025
3.0.54 102 4/6/2025
3.0.53 127 4/5/2025
3.0.52 78 4/5/2025
3.0.51 87 4/5/2025
3.0.50 111 4/5/2025
3.0.49 83 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 83 4/5/2025
3.0.44 132 4/5/2025
3.0.43 89 4/5/2025
3.0.42 106 4/5/2025
3.0.41 80 4/5/2025
3.0.40 83 4/4/2025
3.0.39 103 4/4/2025
3.0.38 388 4/4/2025
3.0.37 202 4/4/2025
3.0.36 152 4/4/2025
3.0.35 153 4/4/2025
3.0.34 162 4/4/2025
3.0.33 255 4/3/2025
3.0.32 155 4/3/2025
3.0.31 172 4/1/2025
3.0.30 138 4/1/2025
3.0.29 213 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 247 4/1/2025
3.0.24 142 4/1/2025
3.0.23 204 4/1/2025
3.0.22 142 3/31/2025
3.0.21 137 3/31/2025
3.0.20 145 3/31/2025
3.0.19 146 3/31/2025
3.0.18 292 3/31/2025
3.0.17 168 3/29/2025
3.0.16 88 3/29/2025
3.0.15 97 3/29/2025
3.0.14 94 3/29/2025
3.0.13 86 3/29/2025
3.0.12 80 3/29/2025
3.0.11 256 3/27/2025
3.0.10 515 3/26/2025
3.0.9 461 3/26/2025
3.0.8 474 3/25/2025
3.0.7 499 3/25/2025
3.0.6 459 3/25/2025
3.0.5 459 3/25/2025
3.0.4 467 3/25/2025
3.0.3 464 3/25/2025
3.0.2 424 3/23/2025
3.0.1 114 3/21/2025