The built-in SmtpAppender does not support parameterise the subject
line. There is an example appender in the 1.2.9 release that does:
SimpleSmtpAppender. You can find the source for it at

log4net-1_2_9\examples\net\1.0\Appenders\SampleAppendersApp\cs\src\Appen
der 

This appender does not buffer events before sending them as the
SmtpAppender does. SimpleSmtpAppender just sends each event in a
separate email, but it does allow the subject to be generated by a
PatternLayout.

To use this appender you will need to compile the SimpleSmtpAppender
class yourself either in a separate dll or as part of your application.

Cheers,
Nicko

> -----Original Message-----
> From: Fahad Sarwar [mailto:[EMAIL PROTECTED] 
> Sent: 20 February 2006 11:18
> To: log4net-user@logging.apache.org
> Subject: SMTPAppender
> 
> Hi All,
>  
> Jsut a quick query.  When sending email log messages, using 
> the SMTP Appender, the Subject is always constant (defined in 
> the config file).  Is it possible to send a different Subject 
> out depending on the message ie if i log at INFO level, send 
> one subject header and for an ERROR log send a different 
> subject header.
>  
> regards
>  
> 
> Fahad Sarwar
> 
> Opal Telecom
> 
> Applications Team
> 
> Irlam
> 
> Tel: +44 161 222 2145
> 
> Fax: +44 161 222 2008
> 
> Email: [EMAIL PROTECTED] 
> 
>  
> 
> This communication together with any attachments transmitted 
> with it ("this E-Mail") is intended only for the use of the 
> addressee and may contain information which is privileged and 
> confidential. If the reader of this E-Mail is not the 
> intended recipient or the employee or agent responsible for 
> delivering it to the intended recipient you are hereby 
> notified that any use, dissemination, forwarding, printing or 
> copying of this E-Mail is strictly prohibited. Addressees 
> should check this E-mail for viruses. The Company makes no 
> representations as regards the absence of viruses in this 
> E-Mail. If you have received this E-Mail in error please 
> notify our IT Support Team immediately by telephone on 0845 
> 456 9100 or via e-mail at [EMAIL PROTECTED] Please 
> then immediately delete, erase or otherwise destroy this 
> E-Mail and any copies of it.
> 
> Any opinions expressed in this E-Mail are those of the author 
> and do not necessarily constitute the views of the Company. 
> Nothing in this E-Mail shall bind the Company in any contract 
> or obligation.
> 
> For the purposes of this E-Mail "the Company" means Opal 
> Telecom Ltd.  Please feel free to visit our website: 
> www.opaltelecom.co.uk <http://www.opaltelecom.co.uk/> 
> 
> Opal Telecom Ltd (Registered in England & Wales No. 3849133) 
> 
> Brinell Drive, Northbank Industrial Park, Irlam, Manchester M44 5BL.
> 
> A member of the Carphone Warehouse Group of Companies
> 
>  
> 

Reply via email to