GeezerVison is showing github.com — log4net.Ext.Mail by FreeAndNil · Pull Request #302 · apache/logging-log4net
Conversation
FreeAndNil
commented
Jul 28, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
fixes #300
Microsoft no longer recommends System.Net.Mail.SmtpClient, and it increasingly
fails against modern mail servers. This adds a satellite assembly
log4net.Ext.Mail with a MailKit based SmtpAppender, so log4net itself takes on
no mail dependency.
- Same options as
log4net.Appender.SmtpAppender - migrating means changing only
the type attribute.
- Behaviour differences:
smtpHost is required, enableSsl negotiates implicit
TLS/STARTTLS automatically, Ntlm needs explicit credentials (MailKit cannot
reuse the Windows logon session), and semicolon-separated recipient lists now
parse correctly.
- Site docs now recommend the new appender; all SMTP samples use it.
- Adds
Log4NetAssert.EnsureNotNullOrEmpty.
Also included, unrelated to #300: TelnetAppender registers the client before
sending the welcome banner, fixing a HasConnections race that dropped messages.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
log4net.Ext.Mail.Appender.SmtpAppender exposes the same options as
log4net.Appender.SmtpAppender, but sends via MailKit instead of the obsolete
System.Net.Mail.SmtpClient. Sending goes through the new ISmtpTransport
abstraction (default: MailKitSmtpTransport) so the appender can be tested
without an SMTP server.
(log messages could be dropped via HasConnections race)
- test: free TCP port, locked receive buffer, assert on stream
content instead of read count, 30s timeout, log client errors
Recommend the MailKit appender from log4net.Ext.Mail over the built-in one,
which relies on the deprecated System.Net.Mail.SmtpClient, and port all
configuration samples to the new type. Adds the changelog entry for #300.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 21, 2026
This was referenced Nov 10, 2026
This was referenced Nov 19, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|