2009-03-09 7 views

答えて

6

あなたがロギングアプリケーションブロックにEmailTraceListenerを設定する必要があります。

あなたは、エンタープライズライブラリUIを使用することができますが、web.configファイルのセクションでは、このような何かを探して終わる:

<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="Default" logWarningsWhenNoCategoriesMatch="true"> 
    <listeners> 
     <add toAddress="[email protected]" fromAddress="[email protected]" 
     subjectLineStarter="" subjectLineEnder="" smtpServer="127.0.0.1" 
     smtpPort="25" formatter="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.EmailTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
     traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.EmailTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
     name="Email" /> 
    </listeners> 
    <categorySources> 
     <add switchValue="All" name="Default"> 
     <listeners> 
      <add name="Email" /> 
     </listeners> 
     </add>  
    </categorySources> 
</loggingConfiguration> 

これは、SMTPサーバーが正しく設定されて提供していきます。 Telnetを使用して、コマンドライン電子メールを送信して確認することができます。

+3

EmailTraceListener(およびその他のエンタープライズライブラリ)の構成を簡素化するフレンドリーなUIにEntLibConfig.exeツールを使用します。 –