EmailTraceListener in Logging Block

Topics: Building and extending application blocks, General discussion, Logging Application Block, Pre-release discussions
May 22, 2009 at 10:22 AM


I am using Enterprise Library 4.1 . I want to send email using EmailTraceListener to send mail when error occurs.

But my SMTP server allows only authenticated users.I want to know how to configure EmailTraceListener for that.



May 22, 2009 at 10:46 AM


I think you are authenticating end users some where in your application.

so when an exception occurs, your EmailTraceListener should Log the exception and email the error stack.

If I get anything wrong, let me know.



May 22, 2009 at 10:49 AM
Edited May 26, 2009 at 2:55 AM

There's no direct support for authenticated emailtracelistener in EntLib but an implementation can be found here -  You can also refer to this discussion.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

Aug 27, 2009 at 7:20 AM

I would just like to share another workaround for for supporting smtp servers requiring authentication without using the Authenticated Email TraceListener.  Found out that the built in EmailTraceListener will work if you configure the <mailSettings> element under the section in your config file.  You can set the default host, port, and credential values for all SmtpClient objects.  Example config:

      <smtp deliveryMethod="Network">

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

Aug 27, 2009 at 7:54 AM

Thanks Sarah

i will check and reply back to you....