logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erlis Vidal" <Evi...@affiliated.ca>
Subject RE: BCC in SMTP Loger Appender!
Date Thu, 20 Dec 2007 15:54:47 GMT
Thanks for your promptly response!

 

Erlis

 

  _____  

From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: Wednesday, December 19, 2007 9:13 PM
To: Log4NET User
Subject: Re: BCC in SMTP Loger Appender!

 

The current implementation doesn't support CC or BCC delivery. You can add
support by using code similiar to this:

public class BccSmtpAppender : SmtpAppender
{
    private string bcc;

    protected override void SendEmail(string messageBody)
    {
        MailMessage mailMessage = new MailMessage();
        mailMessage.Body = messageBody;
        mailMessage.From = new MailAddress(From);
        mailMessage.To.Add(To);
        if (!String.IsNullOrEmpty(Bcc))
        {
            mailMessage.Bcc.Add(Bcc);
        }
        mailMessage.Subject = Subject;
        mailMessage.Priority = Priority;

        // send mail...
    }

    public string Bcc
    {
        get { return bcc; }
        set { bcc = value; }
    }
}

----- Original Message ----
From: Erlis Vidal <Evidal@affiliated.ca>
To: log4net-user@logging.apache.org
Sent: Wednesday, December 19, 2007 1:58:06 PM
Subject: BCC in SMTP Loger Appender!

Just a simple question!

 

It is possible to config the smtp logger appender to use a bcc email
address? 

 

Thanks in advance

Erlis

 


Mime
View raw message