EmailTraceListener in Logging Block

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

Hi

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.

Thanks

 

May 22, 2009 at 11:46 AM

Well.

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.

 

Raju

May 22, 2009 at 11:49 AM
Edited May 26, 2009 at 3:55 AM

There's no direct support for authenticated emailtracelistener in EntLib but an implementation can be found here - http://www.codeplex.com/AuthEmailTraceListen.  You can also refer to this discussion. http://entlib.codeplex.com/Thread/View.aspx?ThreadId=48388

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

Aug 27, 2009 at 8: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 system.net section in your config file.  You can set the default host, port, and credential values for all SmtpClient objects.  Example config:

<system.net>
    <mailSettings>
      <smtp deliveryMethod="Network">
        <network
         host="localhost"
         port="25"
         defaultCredentials="false"
         userName="AvanadeSupport"
         password="Password123"
        />
      </smtp>
    </mailSettings>
</system.net>

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com

 
 
Aug 27, 2009 at 8:54 AM

Thanks Sarah

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