Passing password to EmailTraceListener?

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?
 
Y

Yoganathan Sivaram

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top