Soenneker.Email.Mime 11.0.629

Prefix Reserved
dotnet add package Soenneker.Email.Mime --version 11.0.629
                    
NuGet\Install-Package Soenneker.Email.Mime -Version 11.0.629
                    
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.Email.Mime" Version="11.0.629" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Email.Mime" Version="11.0.629" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Email.Mime" />
                    
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.Email.Mime --version 11.0.629
                    
#r "nuget: Soenneker.Email.Mime, 11.0.629"
                    
#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.Email.Mime@11.0.629
                    
#: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.Email.Mime&version=11.0.629
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Email.Mime&version=11.0.629
                    
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.Email.Mime

A configurable MailKit SMTP sender for MimeMessage objects, with retry handling and optional MIME-content logging.

Install

dotnet add package Soenneker.Email.Mime

Configuration

{
  "Smtp": {
    "Enable": true,
    "Host": "smtp.example.com",
    "Port": 587,
    "Username": "mailer@example.com",
    "Password": "use-a-secret-provider",
    "UseSsl": false,
    "UseStartTls": true,
    "AcceptAnyCert": false,
    "LogContent": false
  }
}

Enable, Host, Port, Username, Password, and UseSsl are required when SMTP is enabled. UseStartTls, AcceptAnyCert, and LogContent default to false. If both TLS flags are true, UseSsl takes precedence and MailKit uses TLS immediately on connection.

Keep credentials in a secret provider rather than source-controlled configuration. Leave AcceptAnyCert false outside isolated development: enabling it disables server-certificate validation and permits interception. If both TLS flags are false, the connection is unencrypted.

Registration

using Microsoft.Extensions.DependencyInjection;
using Soenneker.Email.Mime.Abstract;
using Soenneker.Email.Mime.Registrars;

services.AddMimeUtilAsSingleton();

AddMimeUtilAsScoped() is also available. In that registration, the utility is scoped while its reusable memory-stream dependency remains singleton; disposing a scope does not tear down that shared dependency.

Send a message

using MimeKit;

var message = new MimeMessage();
message.From.Add(MailboxAddress.Parse("mailer@example.com"));
message.To.Add(MailboxAddress.Parse("recipient@example.net"));
message.Subject = "Deployment complete";
message.Body = new TextPart("plain") { Text = "Version 42 is live." };

IMimeUtil mime = serviceProvider.GetRequiredService<IMimeUtil>();
await mime.Send(message, cancellationToken);

When SMTP is disabled, Send and InternalSend log and return without sending. Send retries I/O, socket, timeout, SMTP protocol, and temporary 4xx SMTP command failures five times with exponential backoff and jitter, then rethrows the final failure. Authentication, certificate, invalid-message, and permanent 5xx command failures are not retried. InternalSend performs one attempt and is mainly useful when the caller owns retry behavior.

SMTP delivery is not idempotent: a connection can fail after a server accepts a message but before the client receives confirmation, so any retry strategy can produce duplicates. Use a stable message identifier and downstream deduplication when duplicates are unacceptable. A disconnect failure after an acknowledged send is logged and does not trigger another send.

ConvertMimeMessageToString returns the complete MIME representation, including headers, body, and encoded attachments. LogContent: true writes that data at debug level; leave it disabled when messages may contain personal data, credentials, or confidential attachments.

Cancellation stops pending client work but cannot recall a message already accepted by the SMTP server.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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.Email.Mime:

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
11.0.629 82 11/11/2026
11.0.628 63 11/11/2026
11.0.627 66 11/11/2026
11.0.626 50 11/11/2026
11.0.622 100 11/10/2026
11.0.620 209 11/3/2026
11.0.619 88 11/3/2026
11.0.618 119 11/3/2026
11.0.617 93 11/3/2026
11.0.616 106 11/3/2026
11.0.615 199 10/28/2026
11.0.614 108 10/27/2026
11.0.613 106 10/27/2026
11.0.612 154 10/26/2026
11.0.611 100 10/26/2026
11.0.609 115 10/26/2026
11.0.608 114 10/26/2026
11.0.607 91 10/26/2026
11.0.606 96 10/26/2026
11.0.605 102 10/26/2026
Loading failed

Updated Multiple NuGet packages