Passing password to EmailTraceListener?

  • Thread starter Thread starter Peter Rilling
  • Start date Start date
P

Peter Rilling

Hi.

I am using the logging application blocks and would like to be able to send
errors to an admin so they are seen immediately. The problem is the SMTP
server requires authentication yet I see no where in the EmailTraceListener
where I can supply credential. Is there anyway I can provide a
username/password?
 
Peter,

I think the EmailTraceListener included in the Application block supports
only unauthenticated SMTP server (as most common servers). But if you want
you can modify the EmailMessage Class (especially SendMessage method to
include your authentication information)

E.g.:
smtpClient.Credentials = new System.Net.NetworkCredential(UserName,
SecurelyStoredPassword);
//If your server requires SSL
//smtpClient.EnableSsl = true;
 
Back
Top