You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Reddy, Suresh" <su...@jnli.com> on 2002/12/17 18:37:40 UTC
send mail frmo Log4J using SMTP
hi,
I am having problems sending email from Log4j. can anyone help me regarding
this?
SMTPAppender smtpApp = new SMTPAppender();
smtpApp.setFrom("suresh@something.com");
smtpApp.setTo("suresh@something.com");
smtpApp.setSMTPHost("mail.something.com");
smtpApp.setLocationInfo(true);
smtpApp.setSubject("Test");
org.apache.log4j.PatternLayout pattern = new
org.apache.log4j.PatternLayout() ;
smtpApp.setLayout(pattern);
smtpApp.activateOptions() ;
BasicConfigurator.configure(smtpApp);
CAT.addAppender(smtpApp);
what am i missing here?
thanks,
suresh reddy