Innovabit.DotNet.Interceptors.Notifications.Email 1.0.0.102

There is a newer version of this package available.
See the version list below for details.
dotnet add package Innovabit.DotNet.Interceptors.Notifications.Email --version 1.0.0.102
                    
NuGet\Install-Package Innovabit.DotNet.Interceptors.Notifications.Email -Version 1.0.0.102
                    
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="Innovabit.DotNet.Interceptors.Notifications.Email" Version="1.0.0.102" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Innovabit.DotNet.Interceptors.Notifications.Email" Version="1.0.0.102" />
                    
Directory.Packages.props
<PackageReference Include="Innovabit.DotNet.Interceptors.Notifications.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 Innovabit.DotNet.Interceptors.Notifications.Email --version 1.0.0.102
                    
#r "nuget: Innovabit.DotNet.Interceptors.Notifications.Email, 1.0.0.102"
                    
#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 Innovabit.DotNet.Interceptors.Notifications.Email@1.0.0.102
                    
#: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=Innovabit.DotNet.Interceptors.Notifications.Email&version=1.0.0.102
                    
Install as a Cake Addin
#tool nuget:?package=Innovabit.DotNet.Interceptors.Notifications.Email&version=1.0.0.102
                    
Install as a Cake Tool

Innovabit.DotNet.Interceptors.Notifications.Email

E-mail (SMTP) channel for Innovabit.DotNet.Interceptors.Notifications. Delivers exception notifications by e-mail through MailKit — the actively maintained SMTP client Microsoft itself points to as the replacement for the legacy System.Net.Mail.SmtpClient (which its own documentation says shouldn't be used for new development).

Install

dotnet add package Innovabit.DotNet.Interceptors.Notifications.Email

Usage

services.AddInterceptors()
    .AddNotifications()
    .AddEmail(o =>
    {
        o.Host = "smtp.contoso.com";
        o.Port = 587;
        o.SecureSocketMode = EmailSecureSocketMode.StartTls;
        o.Username = "alerts@contoso.com";
        o.Password = "…";
        o.From = "alerts@contoso.com";
        o.FromDisplayName = "Contoso Alerts";
        o.To.Add("oncall@contoso.com");
        o.MinimumSeverity = NotificationSeverity.Error;
    });

Then annotate methods with [NotifyOnException]. Restrict delivery to this channel with [NotifyOnException(Channels = new[] { "Email" })].

Options

Option Default Description
Host / Port — / 587 SMTP server.
SecureSocketMode null Transport security: None, Auto, SslOnConnect, StartTls, StartTlsWhenAvailable. When left null, it is derived from EnableSsl.
EnableSsl true Legacy flag. true → Auto, false → None. SecureSocketMode wins when set.
Username / Password null When Username is empty the connection is used without authentication.
From / FromDisplayName — / null Sender address and optional display name.
ReplyTo null Optional "Reply-To" address.
To / Cc / Bcc [] Recipients. To must have at least one entry.
IsBodyHtml false Send the body as HTML instead of plain text. Ignored when the message already carries an HtmlBody (see below).
Timeout 30 s Connect / authenticate / send timeout.
MarkCriticalAsUrgent true Flag Critical notifications with urgent priority and high importance headers.
MinimumSeverity Information Messages below this severity are skipped.

NotificationMessage.Metadata entries are written as X-Notification-<key> headers.

HTML e-mails from a template

A message that carries an HtmlBody — what a template with an .html variant produces — is sent as multipart/alternative: the HTML for rich clients and Body as the plain text fallback. IsBodyHtml then plays no part; it only decides how a message with a single body is sent.

services.AddInterceptors()
    .AddNotifications()
    .AddTemplates()
    .AddTemplatesFromDirectory("Templates")   // order-failed.txt + order-failed.Email.html
    .AddEmail(o => { ... });

Transport security

Auto (the effective default) picks implicit TLS on port 465 and STARTTLS on any other port, which is what most providers expect. Set SecureSocketMode explicitly when a server needs a specific handshake — for example StartTls to require the upgrade on 587 and fail rather than fall back to an unencrypted session.

Migrating from the System.Net.Mail version

The configuration API is unchanged: Host, Port, EnableSsl, Username, Password, From, To, IsBodyHtml and MinimumSeverity keep working exactly as before. What changes underneath:

  • MailKit replaces SmtpClient, so the package now has a MailKit dependency.
  • EnableSsl = true now means Auto (implicit TLS on 465, STARTTLS elsewhere) instead of SmtpClient.EnableSsl, which only ever attempted STARTTLS.
  • Missing Host or From now throw InvalidOperationException (with the offending option named) instead of a lower-level ArgumentException.
  • Sends time out after 30 seconds by default rather than 100.

Part of

The Innovabit.DotNet.Interceptors suite — github.com/Innovabit/dotnet-interceptors.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.119 54 11/14/2026
2.0.118 115 11/7/2026
2.0.117 111 10/31/2026
2.0.116 107 10/26/2026
2.0.115 113 10/17/2026
2.0.114 110 10/10/2026
2.0.113 121 10/3/2026
2.0.112 117 9/28/2026
2.0.111 95 9/28/2026
2.0.110 107 9/27/2026
2.0.109 110 9/26/2026
2.0.108 103 9/26/2026
2.0.107 107 9/26/2026
2.0.106 120 9/25/2026
2.0.105 98 9/25/2026
1.0.0.104 118 9/25/2026
1.0.0.103 103 9/25/2026
1.0.0.102 103 9/25/2026
1.0.0.101 99 9/25/2026
1.0.0.100 98 9/25/2026
Loading failed