views:

15

answers:

1

I've been trying to add cc and bcc addresses to log4net's SmtpAppender but I'm getting no flair:

<appender name="Mail" type="log4net.Appender.SmtpAppender">
  <to value="[email protected]" />
  <cc value="[email protected]" />
  <bcc value="[email protected]" />
  <from value="[email protected]" />
  <subject value="Some pearls of wisdom for you" />
  <smtpHost value="localhost" />
  <bufferSize value="4096" />
  <lossy value="false" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%newline%date [%-4level]%message" />
  </layout>
</appender>

I'm currently using log4net version 1.2.10.0, if anyone could help me out I'd be very glad.

+1  A: 

According to this documentation, there is no cc and bcc fields in the SMTP appender.

You can use a semicolon-separated list for the To attribute (which would be almost equivalent to cc). But no solution for bcc.

You could create a class deriving from SmtpAppender, which adds these properties.

Timores
According to http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/200712.mbox/%3C33016839.1198118863050.JavaMail.jira@brutus%3E it's going to be available at 1.2.11?
Nano Taboada