I wrote an article that explains how to use Log4j's SMTPAppender. Also, the article introduces the SMTPHandler for java.util.logging

http://www.onjava.com/pub/a//onjava/2004/09/29/smtp-logging.html