VOOZH about

URL: https://www.nuget.org/packages/NLog.MailKit/

⇱ NuGet Gallery | NLog.MailKit 6.1.4




👁 Image
NLog.MailKit 6.1.4

Prefix Reserved
dotnet add package NLog.MailKit --version 6.1.4
 
 
NuGet\Install-Package NLog.MailKit -Version 6.1.4
 
 
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="NLog.MailKit" Version="6.1.4" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NLog.MailKit" Version="6.1.4" />
 
Directory.Packages.props
<PackageReference Include="NLog.MailKit" />
 
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 NLog.MailKit --version 6.1.4
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NLog.MailKit, 6.1.4"
 
 
#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 NLog.MailKit@6.1.4
 
 
#: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=NLog.MailKit&version=6.1.4
 
Install as a Cake Addin
#tool nuget:?package=NLog.MailKit&version=6.1.4
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NLog.MailKit

👁 NuGet
👁 Build Status
👁 Bugs
👁 Vulnerabilities
👁 alternate text is missing from this package README image
👁 Coverage

Alternative Mail target for NLog using MailKit.

The NLog MailKit Target is able to replace the original NLog Mail Target and provides the same options.

See the NLog Wiki for available options and examples.

  • Can also be combined with FallbackGroup to fallback to alternative SMTP-server on error.
  • Can also be combined with BufferingWrapper to group multiple logevents into a single email.
  • Can also be combined with LimitingWrapper to throttle the number of emails.
  • Can also be combined with FilteringWrapper to avoid repeating identical emails.

If having trouble with output, then check NLog InternalLogger for clues. See also Troubleshooting NLog

This library is integration tested with the SmtpServer NuGet package

How to use

  1. Install the package:

    Install-Package NLog.MailKit or in your csproj:

    <PackageReference Include="NLog.MailKit" Version="6.*" />
    
  2. Add to your nlog.config:

    <extensions>
     <add assembly="NLog.MailKit"/>
    </extensions>
    

    Alternative register from code using fluent configuration API:

    LogManager.Setup().SetupExtensions(ext => ext.RegisterTarget<NLog.MailKit.MailTarget>());
    

Note that the option skipCertificateValidation="true" can prevent AuthenticationException if your remote certificate for smtpServer is invalid - not recommend!

OAuth2 Authentication

Mailkit supports OAuth2 authentication by specifying SmtpAuthentication = OAuth2 together with:

  • SmtpUserName = ${gdc:OAuthClientId}
  • SmtpPassword = ${gdc:OAuthClientSecret}

Before using OAuth2 authentication, make sure to acquire an access token from your email provider (e.g., Gmail, Outlook). This can be implemented with a Custom NLog Layout Renderer, or by storing the details in environment variable or NLog Global Diagnostics Context (GDC) and point SmtpUserName and SmtpPassword to these locations.

License

BSD. License of MailKit is MIT

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 is compatible. 
.NET Framework net461 net461 was computed.  net462 net462 is compatible.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (49)

Showing the top 5 NuGet packages that depend on NLog.MailKit:

Package Downloads
Ark.Tools.NLog

NLog configuration helper and extensions for Ark standard configuration using code and not config files.

Ark.Tools.Solid

SOLID base for Handler pattern

Ark.Tools.ResourceWatcher

Watcher over listable resources with support for change detection, retry limit and state.

Ark.Tools.FtpClient.Core

Core abstractions for FtpClient

Ark.Tools.Sql.SqlServer

Extensions and helpers of Ark.Tools.Sql for SqlServer

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on NLog.MailKit:

Repository Stars
NLog/NLog
NLog - Flexible and Structured Logging for various .NET Platforms
Version Downloads Last Updated
6.1.4 10,077 5/9/2026
6.1.3 10,718 4/4/2026
6.1.2 357 4/4/2026
6.1.1 10,182 3/7/2026
6.0.5 47,488 11/15/2025
6.0.4 15,946 11/15/2025
6.0.3 55,174 7/20/2025
6.0.2 17,228 7/20/2025
6.0.0 20,487 7/2/2025
5.3.0 167,448 11/16/2024
5.2.0 221,871 8/30/2023
5.1.0 17,087 8/30/2023
5.0.0 229,367 5/22/2022
4.1.0 335,412 2/7/2022
4.0.0 61,627 11/6/2021
3.4.0 35,631 11/4/2021
3.3.0 450,475 8/27/2020
3.2.0 246,896 4/16/2020
3.1.0 285,435 8/30/2019
3.0.2 90,078 4/14/2019
Loading failed

Changelog:

- Updated MailKit ver. 4.16.0 (Security fix)
- Updated NLog ver. 6.1.3

See https://github.com/NLog/NLog.MailKit/releases