|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.AppenderSkeleton
org.lexevs.logging.SimpleEmailAppender
public class SimpleEmailAppender
Simple SMTP Client that allows your Java App send emails. Uses Java Sockets to connect directly to an SMTP server. It supports sending of plain text or HTML emails. Bonus: Unlike many other Java SMTP Sockets examples, this one actually works.
Field Summary | |
---|---|
protected org.apache.log4j.helpers.CyclicBuffer |
_m_cb
The _m_cb. |
protected org.apache.log4j.spi.TriggeringEventEvaluator |
_m_evaluator
The _m_evaluator. |
Fields inherited from class org.apache.log4j.AppenderSkeleton |
---|
closed, errorHandler, headFilter, layout, name, tailFilter, threshold |
Constructor Summary | |
---|---|
SimpleEmailAppender()
Instantiates a new simple email appender. |
|
SimpleEmailAppender(org.apache.log4j.spi.TriggeringEventEvaluator evaluator)
Instantiates a new simple email appender. |
Method Summary | |
---|---|
protected void |
append(org.apache.log4j.spi.LoggingEvent event)
|
protected boolean |
checkEntryConditions()
Check entry conditions. |
void |
close()
|
static void |
main(java.lang.String[] args)
The main method. |
boolean |
requiresLayout()
|
java.lang.String |
send(java.lang.String host,
int port,
java.lang.String to,
java.lang.String from,
java.lang.String subject,
java.lang.String message)
Sends an email. |
void |
setBufferSize(int bufferSize)
Sets the buffer size. |
void |
setFrom(java.lang.String from)
Sets the from. |
void |
setSMTPHost(java.lang.String smtpHost)
Sets the sMTP host. |
void |
setSubject(java.lang.String subject)
Sets the subject. |
void |
setTo(java.lang.String to)
Sets the to. |
Methods inherited from class org.apache.log4j.AppenderSkeleton |
---|
activateOptions, addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.log4j.spi.TriggeringEventEvaluator _m_evaluator
protected org.apache.log4j.helpers.CyclicBuffer _m_cb
Constructor Detail |
---|
public SimpleEmailAppender()
public SimpleEmailAppender(org.apache.log4j.spi.TriggeringEventEvaluator evaluator)
evaluator
- the evaluatorMethod Detail |
---|
public void setTo(java.lang.String to)
to
- the new topublic void setFrom(java.lang.String from)
from
- the new frompublic void setSubject(java.lang.String subject)
subject
- the new subjectpublic void setSMTPHost(java.lang.String smtpHost)
smtpHost
- the new sMTP hostpublic void setBufferSize(int bufferSize)
bufferSize
- the new buffer sizepublic java.lang.String send(java.lang.String host, int port, java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String message) throws java.lang.Exception
host
- the hostport
- the portto
- the tofrom
- the fromsubject
- the subjectmessage
- the message
java.lang.Exception
- the exceptionprotected void append(org.apache.log4j.spi.LoggingEvent event)
append
in class org.apache.log4j.AppenderSkeleton
protected boolean checkEntryConditions()
public void close()
public boolean requiresLayout()
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- the arguments
java.lang.Exception
- the exception
|
Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |