Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Log4Net haven an smtp appender that support TLS Encryption?

Tags:

ssl

log4net

As stated in the title, I've had some issues finding an appender that states that it support the TLS encryption standard.

I've been trying to use the SmtpAppender but can't get it to work and suspect it has to do with the smtp server requiring TLS encryption and SmtpAppender might not supporting this.

setup from Office365 manual

The Manual

The configuration used:

<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
  <to value="my email" />
  <from value="The senders email" />
  <Username value="JohnDoe"></Username>
  <password value="NoWay" ></password>
  <authentication value="Basic"></authentication>
  <subject value="Test message" />
  <smtpHost value="pod51011.outlook.com" />
  <port value="587" />
  <bufferSize value="512" />
  <lossy value="true" />
  <EnableSsl value="true"/>
  <evaluator type="log4net.Core.LevelEvaluator">
      <threshold value="INFO"/>
  </evaluator>
  <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%newline%date [%thread] %-5level %logger [%property{NDC}] - %message%newline%newline%newline" />
  </layout>
</appender>
like image 748
Rune Andersen Avatar asked Dec 06 '12 10:12

Rune Andersen


1 Answers

After some extra researching and actually testing using the newest Log4Net version 1.2.11 the answer is: Yes.

The question is somewhat answered here C# ASP.NET Send Email via TLS and looking into the issue tracking of Log4Net allow smtp to ssl authenticate and with certificates. it is documented that Log4Net has a switch EnableSsl which, as implied by the name, enables SSL supporty which by first link falls under TLS.

like image 194
Rune Andersen Avatar answered Sep 22 '22 09:09

Rune Andersen