|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.core.net.AbstractSendEmail
adams.core.net.ApacheSendEmail
public class ApacheSendEmail
Uses Apache commons-net SMTPClient or SMTPSClient for
sending emails.
| Field Summary | |
|---|---|
protected org.apache.commons.net.smtp.SMTPClient |
m_Client
the SMTP client. |
protected BasePassword |
m_Password
the password to use for authentication. |
protected int |
m_Port
the server port. |
protected boolean |
m_RequiresAuth
whether authentication is required. |
protected String |
m_Server
the server to connect to. |
protected int |
m_Timeout
the timeout for the server. |
protected String |
m_User
the user to use for authenticating. |
protected boolean |
m_UseTLS
whether to use TLS. |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
ApacheSendEmail()
|
|
| Method Summary | |
|---|---|
String |
globalInfo()
Returns a string describing the object. |
void |
initializeSmtpSession(String server,
int port,
boolean useTLS,
int timeout,
boolean requiresAuth,
String user,
BasePassword pw)
Initializes the SMTP session. |
boolean |
requiresSmtpSessionInitialization()
Returns whether the SMTP session needs to be initialized. |
boolean |
sendMail(Email email)
Sends an email. |
| Methods inherited from class adams.core.option.AbstractOptionHandler |
|---|
cleanUpOptions, debug, debug, debugLevelTipText, defineOptions, destroy, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString |
| Methods inherited from class adams.core.ConsoleObject |
|---|
getDebugging, getSystemErr, getSystemOut, sizeOf |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected transient org.apache.commons.net.smtp.SMTPClient m_Client
protected String m_Server
protected int m_Port
protected boolean m_UseTLS
protected int m_Timeout
protected boolean m_RequiresAuth
protected String m_User
protected BasePassword m_Password
| Constructor Detail |
|---|
public ApacheSendEmail()
| Method Detail |
|---|
public String globalInfo()
globalInfo in class AbstractOptionHandlerpublic boolean requiresSmtpSessionInitialization()
requiresSmtpSessionInitialization in class AbstractSendEmail
public void initializeSmtpSession(String server,
int port,
boolean useTLS,
int timeout,
boolean requiresAuth,
String user,
BasePassword pw)
throws Exception
initializeSmtpSession in class AbstractSendEmailserver - the SMTP serverport - the SMTP portuseTLS - whether to use TLStimeout - the timeoutrequiresAuth - whether authentication is requireduser - the SMTP userpw - the SMTP password
Exception - if initialization fails
public boolean sendMail(Email email)
throws Exception
sendMail in class AbstractSendEmailemail - the email to send
Exception - in case of invalid internet addresses or messaging problem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||