Skip to content

Commit

Permalink
Updated README.md of how to register from code (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot authored Oct 15, 2023
1 parent 78fee64 commit b6304f1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ This library is integration tested with the [SmtpServer NuGet package](https://w
</extensions>
```

Use the target "mail"
and config options can be found here: https://github.com/NLog/NLog/wiki/Mail-Target
Alternative register from code using [fluent configuration API](https://github.com/NLog/NLog/wiki/Fluent-Configuration-API):

Use `skipCertificateValidation="true"` for prevent `AuthenticationException` if your remote certificate for smtpServer is invalid - not recommend!
```xml
LogManager.Setup().SetupExtensions(ext => ext.RegisterTarget<NLog.MailKit.MailTarget>());
```

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
Expand Down

0 comments on commit b6304f1

Please sign in to comment.