https://github.com/NLog/NLog.MailKit
:mailbox_with_mail: Alternative Mail target for NLog using MailKit
https://github.com/NLog/NLog.MailKit
csharp dotnet mail mailkit net-core net45 netstandard netstandard20 nlog nlog-target
Last synced: about 2 months ago
JSON representation
:mailbox_with_mail: Alternative Mail target for NLog using MailKit
- Host: GitHub
- URL: https://github.com/NLog/NLog.MailKit
- Owner: NLog
- License: bsd-3-clause
- Created: 2017-04-29T13:26:51.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-23T16:04:49.000Z (11 months ago)
- Last Synced: 2024-09-17T01:38:33.932Z (8 months ago)
- Topics: csharp, dotnet, mail, mailkit, net-core, net45, netstandard, netstandard20, nlog, nlog-target
- Language: C#
- Homepage:
- Size: 174 KB
- Stars: 13
- Watchers: 5
- Forks: 8
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dotnet-core - NLog.MailKit - 使用using MailKit库的替代邮件目标 (框架, 库和工具 / 日志)
- fucking-awesome-dotnet-core - NLog.MailKit - Alternative Mail target using the using MailKit library (Frameworks, Libraries and Tools / Logging)
- awesome-dotnet-core - NLog.MailKit - Alternative Mail target using the using MailKit library (Frameworks, Libraries and Tools / Logging)
README
# NLog.MailKit
[](https://www.nuget.org/packages/NLog.MailKit)
[](https://dev.azure.com/NLogLogging/NLog/_build/latest?definitionId=25&branchName=master)
[](https://sonarcloud.io/summary/new_code?id=nlog.mailkit)
[](https://sonarcloud.io/summary/new_code?id=nlog.mailkit)
[](https://sonarcloud.io/project/issues?id=nlog.mailkit&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=nlog.mailkit&metric=coverage)Alternative Mail target for [NLog](https://github.com/nlog/nlog) using [MailKit](https://github.com/jstedfast/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](https://github.com/NLog/NLog/wiki/Mail-Target)Currently not implemented:
- NTLM auth
This library is integration tested with the [SmtpServer NuGet package](https://www.nuget.org/packages/SmtpServer/)
### How to use
1) Install the package:
`Install-Package NLog.MailKit` or in your csproj:
```xml
```2) Add to your nlog.config:
```xml
```Alternative register from code using [fluent configuration API](https://github.com/NLog/NLog/wiki/Fluent-Configuration-API):
```xml
LogManager.Setup().SetupExtensions(ext => ext.RegisterTarget());
```See the [NLog Wiki](https://github.com/NLog/NLog/wiki/Mail-Target) for available options and examples.
Note that the option `skipCertificateValidation="true"` can prevent `AuthenticationException` if your remote certificate for smtpServer is invalid - not recommend!
### License
BSD. License of MailKit is MIT