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="nanotaboada@stackoverflow.com" />
<cc value="spam@stackoverflow.com" />
<bcc value="junk@stackoverflow.com" />
<from value="itsme@chucknorris.com" />
<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" />
&l开发者_如何学Ct;/layout>
</appender>
I'm currently using log4net version 1.2.10.0, if anyone could help me out I'd be very glad.
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.
There is no bcc or cc, but you can use multiple 'to' addresses.
You actually need to use commas as separators most of the time. For .Net later than 1.1 you need commas, before you need semicolons.
精彩评论