Log4net html formatted SmtpAppender

.net, log4net, logging, smtp

Solution

The built in SmtpAppender does not support this so you will need to roll your own appender.

Problem

I am trying to send me email in HTML format. ``` <appender name="SmtpAppender" type="log4net.Appender.SmtpAppender"> <to value="zzz@zzz.com"/> <from value="do_not_reply@zz.com"/> <subject value="zzzAdmin Logged Event" /> <smtpHost value="email.zzz.com"/> <bufferSize value="1"/> <lossy value="false"/> <authentication value="Basic" /> ``` I log the error as html formatted text, but the email clients render the HTML as plain text. How can I tell the SMTPAppender to add an HTML type to the email message so clients will render the message as the HTML that it is.

Original source