Skip to content

NLog target for sending logevents as email messages using SMTP

License

NLog/NLog.Targets.Mail

Repository files navigation

NLog Mail Target

Version AppVeyor

NLog Mail Target for sending email using .NET SmtpClient for each logevent. 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

See the NLog Wiki for available options and examples.

Register Extension

NLog will only recognize type-alias Mail when loading from NLog.config-file, if having added extension to NLog.config-file:

<extensions>
    <add assembly="NLog.Targets.Mail"/>
</extensions>

Alternative register from code using fluent configuration API:

LogManager.Setup().SetupExtensions(ext => {
   ext.RegisterTarget<NLog.Targets.MailTarget>();
});

About

NLog target for sending logevents as email messages using SMTP

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages