Soenneker.Extensions.Dtos.Email 3.0.46

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.46
                    
NuGet\Install-Package Soenneker.Extensions.Dtos.Email -Version 3.0.46
                    
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.46" />
                    
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.46" />
                    
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.46
                    
#r "nuget: Soenneker.Extensions.Dtos.Email, 3.0.46"
                    
#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.46
                    
Install Soenneker.Extensions.Dtos.Email as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.Dtos.Email&version=3.0.46
                    
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.173 0 6/3/2025
3.0.172 0 6/2/2025
3.0.171 3 6/2/2025
3.0.170 151 5/28/2025
3.0.169 108 5/28/2025
3.0.168 120 5/27/2025
3.0.167 187 5/27/2025
3.0.166 145 5/27/2025
3.0.165 117 5/27/2025
3.0.164 140 5/27/2025
3.0.163 129 5/27/2025
3.0.162 128 5/27/2025
3.0.161 204 5/25/2025
3.0.160 125 5/25/2025
3.0.159 200 5/23/2025
3.0.158 109 5/23/2025
3.0.157 104 5/23/2025
3.0.156 103 5/23/2025
3.0.155 112 5/23/2025
3.0.154 121 5/23/2025
3.0.153 128 5/22/2025
3.0.152 124 5/22/2025
3.0.151 486 5/14/2025
3.0.150 269 5/14/2025
3.0.149 211 5/14/2025
3.0.148 298 5/8/2025
3.0.147 129 5/8/2025
3.0.146 203 5/8/2025
3.0.145 127 5/8/2025
3.0.144 131 5/8/2025
3.0.143 126 5/8/2025
3.0.142 131 5/7/2025
3.0.141 128 5/7/2025
3.0.140 130 5/7/2025
3.0.139 332 5/6/2025
3.0.138 149 5/5/2025
3.0.137 138 5/5/2025
3.0.136 156 5/5/2025
3.0.135 149 5/5/2025
3.0.134 126 5/5/2025
3.0.133 153 5/5/2025
3.0.132 123 5/5/2025
3.0.131 124 5/5/2025
3.0.130 180 5/5/2025
3.0.129 129 5/5/2025
3.0.128 160 5/5/2025
3.0.126 164 5/5/2025
3.0.125 241 4/29/2025
3.0.124 204 4/27/2025
3.0.123 90 4/27/2025
3.0.122 150 4/26/2025
3.0.121 60 4/26/2025
3.0.120 419 4/9/2025
3.0.119 155 4/9/2025
3.0.118 154 4/9/2025
3.0.117 150 4/8/2025
3.0.116 163 4/8/2025
3.0.115 145 4/8/2025
3.0.114 146 4/8/2025
3.0.113 151 4/8/2025
3.0.112 144 4/8/2025
3.0.111 152 4/8/2025
3.0.110 149 4/8/2025
3.0.109 155 4/8/2025
3.0.108 145 4/8/2025
3.0.107 418 4/8/2025
3.0.106 138 4/8/2025
3.0.105 138 4/8/2025
3.0.104 158 4/8/2025
3.0.103 145 4/8/2025
3.0.102 153 4/8/2025
3.0.101 145 4/8/2025
3.0.100 149 4/8/2025
3.0.99 144 4/8/2025
3.0.98 140 4/8/2025
3.0.97 152 4/8/2025
3.0.96 142 4/8/2025
3.0.95 147 4/8/2025
3.0.94 137 4/7/2025
3.0.93 150 4/7/2025
3.0.92 138 4/7/2025
3.0.91 373 4/7/2025
3.0.90 143 4/7/2025
3.0.89 145 4/7/2025
3.0.88 200 4/7/2025
3.0.87 142 4/7/2025
3.0.86 144 4/7/2025
3.0.85 149 4/7/2025
3.0.84 145 4/7/2025
3.0.83 264 4/7/2025
3.0.82 146 4/7/2025
3.0.81 148 4/7/2025
3.0.80 147 4/7/2025
3.0.79 145 4/7/2025
3.0.78 216 4/7/2025
3.0.77 146 4/7/2025
3.0.76 149 4/7/2025
3.0.75 187 4/7/2025
3.0.74 150 4/7/2025
3.0.73 175 4/6/2025
3.0.72 142 4/6/2025
3.0.71 144 4/6/2025
3.0.70 153 4/6/2025
3.0.69 144 4/6/2025
3.0.68 139 4/6/2025
3.0.67 158 4/6/2025
3.0.66 116 4/6/2025
3.0.65 137 4/6/2025
3.0.64 126 4/6/2025
3.0.63 126 4/6/2025
3.0.62 118 4/6/2025
3.0.61 126 4/6/2025
3.0.60 133 4/6/2025
3.0.59 103 4/6/2025
3.0.58 97 4/6/2025
3.0.57 98 4/6/2025
3.0.56 118 4/6/2025
3.0.55 108 4/6/2025
3.0.54 100 4/6/2025
3.0.53 125 4/5/2025
3.0.52 75 4/5/2025
3.0.51 85 4/5/2025
3.0.50 106 4/5/2025
3.0.49 80 4/5/2025
3.0.48 94 4/5/2025
3.0.47 79 4/5/2025
3.0.46 82 4/5/2025
3.0.45 80 4/5/2025
3.0.44 128 4/5/2025
3.0.43 86 4/5/2025
3.0.42 102 4/5/2025
3.0.41 77 4/5/2025
3.0.40 78 4/4/2025
3.0.39 100 4/4/2025
3.0.38 385 4/4/2025
3.0.37 199 4/4/2025
3.0.36 148 4/4/2025
3.0.35 150 4/4/2025
3.0.34 160 4/4/2025
3.0.33 251 4/3/2025
3.0.32 152 4/3/2025
3.0.31 170 4/1/2025
3.0.30 136 4/1/2025
3.0.29 208 4/1/2025
3.0.28 137 4/1/2025
3.0.27 135 4/1/2025
3.0.26 218 4/1/2025
3.0.25 245 4/1/2025
3.0.24 140 4/1/2025
3.0.23 201 4/1/2025
3.0.22 140 3/31/2025
3.0.21 135 3/31/2025
3.0.20 143 3/31/2025
3.0.19 144 3/31/2025
3.0.18 289 3/31/2025
3.0.17 166 3/29/2025
3.0.16 85 3/29/2025
3.0.15 92 3/29/2025
3.0.14 92 3/29/2025
3.0.13 85 3/29/2025
3.0.12 78 3/29/2025
3.0.11 254 3/27/2025
3.0.10 513 3/26/2025
3.0.9 460 3/26/2025
3.0.8 471 3/25/2025
3.0.7 495 3/25/2025
3.0.6 458 3/25/2025
3.0.5 458 3/25/2025
3.0.4 466 3/25/2025
3.0.3 463 3/25/2025
3.0.2 422 3/23/2025
3.0.1 111 3/21/2025