You need to configure EmailTraceListener in the Application Logging block.
You can use the Enterprise Library user interface, but the web.config section looks something like this:
<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="Default" logWarningsWhenNoCategoriesMatch="true"> <listeners> <add toAddress="admin@company.com" fromAddress="fromemail@company.com" 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>
This will work if your SMTP server is configured correctly. You can use Telnet to verify this by sending email at the command line.
tentonipete
source share