9

タイトルで述べたように、TLS 暗号化標準をサポートすると述べているアペンダーを見つけるのにいくつか問題がありました。

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>
4

2 に答える 2

6

最新の Log4Net バージョン 1.2.11 を使用して追加の調査と実際のテストを行った結果、答えは「はい」です。

この質問は、C# ASP.NET Send Email via TLSでいくらか回答されており、Log4Net の問題追跡を調べて、smtp で ssl 認証と証明書を使用できるようにします。Log4NetにはスイッチEnableSslがあり、名前が示すように、最初のリンクでTLSに分類されるSSLサポートを有効にすることが文書化されています。

于 2012-12-06T15:16:20.817 に答える