NLog.MailKit

NLog Mail Target for .NET Core & .NET Standard 2.0+ using MailKit. This package add the mail target to NLog and has the same options* as the original Mail Target. If the mail target was already available on your platform, this package will overwrite the original Mail Target. * Compared to the original MailTarget, the following options aren't implemented: - NTLM auth * MailKit gives more control of the sockets, so you get the `secureSocketOption` option for free!


Keywords
nlog, mail, mailkit, netcore, smtp, email, csharp, dotnet, net-core, net45, netstandard, netstandard20, nlog-target
License
BSD-3-Clause
Install
Install-Package NLog.MailKit -Version 5.2.0

Documentation

NLog.MailKit

NuGet Build Status Bugs Vulnerabilities

Alternative Mail target for NLog using MailKit. Compatible with .NET standard 2+

Including this package will replace the original mail target and has the same options as the original mail target, see docs of the original mailTarget

Currently not implemented:

  • NTLM auth

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="5.*" />
  2. Add to your nlog.config:

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

Use the target "mail" and config options can be found here: https://github.com/NLog/NLog/wiki/Mail-Target

Use skipCertificateValidation="true" for prevent AuthenticationException if your remote certificate for smtpServer is invalid - not recommend!

License

BSD. License of MailKit is MIT