You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Mohd. Amin" <mo...@gmail.com> on 2004/06/17 12:02:03 UTC

SMTPAuthenticateAppender

Hi,

I needed an appender which could log into the smtp server because most
smtp servers do not allow sending email to other domains;relaying(
they should do so anyway).  I created an appender which is the same as
SMTPAppenderexcept for the authentication part.

For configuration, just add the additional parameters
##
log4j.appender.email = org.apache.log4j.net.SMTPAuthenticateAppender
log4j.appender.email.BufferSize = 1024
log4j.appender.email.From = <from email>
log4j.appender.email.To = <to email>
log4j.appender.email.SMTPHost = <mail server>
log4j.appender.email.Subject = <subject>
###### Additional ######
log4j.appender.email.UserName = <mail server username>
log4j.appender.email.Password = <mail server password>
log4j.appender.email.Authenticate = <true> ignore case, if something
else than true, no authentication will be done>
###### End Additional ######
log4j.appender.email.layout = org.apache.log4j.PatternLayout
log4j.appender.email.layout.conversionPattern = %d %-5p [%-10t] %c{2} - %m%n

Hope this is helpful

Amin