Innovabit.DotNet.Interceptors.Notifications.Email
2.0.117
See the version list below for details.
dotnet add package Innovabit.DotNet.Interceptors.Notifications.Email --version 2.0.117
NuGet\Install-Package Innovabit.DotNet.Interceptors.Notifications.Email -Version 2.0.117
<PackageReference Include="Innovabit.DotNet.Interceptors.Notifications.Email" Version="2.0.117" />
<PackageVersion Include="Innovabit.DotNet.Interceptors.Notifications.Email" Version="2.0.117" />
<PackageReference Include="Innovabit.DotNet.Interceptors.Notifications.Email" />
paket add Innovabit.DotNet.Interceptors.Notifications.Email --version 2.0.117
#r "nuget: Innovabit.DotNet.Interceptors.Notifications.Email, 2.0.117"
#:package Innovabit.DotNet.Interceptors.Notifications.Email@2.0.117
#addin nuget:?package=Innovabit.DotNet.Interceptors.Notifications.Email&version=2.0.117
#tool nuget:?package=Innovabit.DotNet.Interceptors.Notifications.Email&version=2.0.117
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 aMailKitdependency. EnableSsl = truenow meansAuto(implicit TLS on 465, STARTTLS elsewhere) instead ofSmtpClient.EnableSsl, which only ever attempted STARTTLS.- Missing
HostorFromnow throwInvalidOperationException(with the offending option named) instead of a lower-levelArgumentException. - Sends time out after 30 seconds by default rather than 100.
Part of
The Innovabit.DotNet.Interceptors suite —
github.com/Innovabit/dotnet-interceptors.
| Product | Versions 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. |
-
net10.0
- Innovabit.DotNet.Interceptors.Notifications.Abstractions (>= 2.0.117)
- MailKit (>= 4.18.2)
-
net8.0
- Innovabit.DotNet.Interceptors.Notifications.Abstractions (>= 2.0.117)
- MailKit (>= 4.18.2)
-
net9.0
- Innovabit.DotNet.Interceptors.Notifications.Abstractions (>= 2.0.117)
- MailKit (>= 4.18.2)
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 |