Enterprise Library .NET 2.0 Logging - HTML email

Looking for examples on how to send an HTML formatted email using Enterprise Library for .NET 2.0 (Jan 2006) in the Logging Application Block.

Most tutorials I have seen show text emails, which in my opinion are obvious since it comes set up for that.  Any ideas on how to customize the email format to HTML
LVL 35
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I recommend you to create another "sink", for example, an HTMLEmailSink, and configure the LogStrategy to use that sink depending on the configuration.

Another idea is to change the existing EmailSink. The text probably gets formatted there.

I don't know exactly what you need, but those are interesting idea.

Since the Enterprise Library sometimes need to be registered with strong name and any change make us re-register it all, I created my own Logging Application Block code. It's very simple and allows us to configure the logging, to create as many LogSinks as we need, to simply modify the LogStrategy and to avoid using the Configuration Application Block.

mrichmonAuthor Commented:

Sinks are in .NET 1.1.  They are no longer present in the Logging Application Block for Enterprise Library for .NET 2.0  Instead there are Trace Listeners, Formatters, etc.

As far as I have been able to determine there is no way to directly create html email messages.  The only option I see is to modify the Logging.Configuration.EmailMessage class to also take in a bit field indicating if you want HTML messages or Text messages.  Although I have not figured out how to then cause this change to be an option through the enterprise library configuration interface, only to manually modify the config file....

Please read the question carefully and do not answer if you don't know the situation being discussed.
mrichmonAuthor Commented:
Okay I found how to do this.  Not built in, but what I ended up doing was modifying Enterprise libarary to accept a parameter called IsBodyHtml.  I passed this parameter through all the way so that it can be accessed as a boolean field in the Enterprise Library confiuration program.

No I can set a bit field per listener to achieve this.

For others:

The files I needed to modify in the Logging and related assemblies included:
Closed, 250 points refunded.
The Experts Exchange
Community Support Moderator of all Ages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.