adams.core.net
Class AbstractSendEmail
java.lang.Object
adams.core.ConsoleObject
adams.core.option.AbstractOptionHandler
adams.core.net.AbstractSendEmail
- All Implemented Interfaces:
- Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable
- Direct Known Subclasses:
- ApacheSendEmail, JavaMailSendEmail
public abstract class AbstractSendEmail
- extends AbstractOptionHandler
Ancestor for classes that can send emails.
- Version:
- $Revision: 7123 $
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
| Methods inherited from class adams.core.option.AbstractOptionHandler |
cleanUpOptions, debug, debug, debugLevelTipText, defineOptions, destroy, finishInit, getDebugLevel, getOptionManager, globalInfo, initialize, isDebugOn, newOptionManager, reset, setDebugLevel, toCommandLine, toString |
AbstractSendEmail
public AbstractSendEmail()
requiresSmtpSessionInitialization
public abstract boolean requiresSmtpSessionInitialization()
- Returns whether the SMTP session needs to be initialized.
- Returns:
- true if the SMTP session needs to be initialized
initializeSmtpSession
public abstract void initializeSmtpSession(String server,
int port,
boolean useTLS,
int timeout,
boolean requiresAuth,
String user,
BasePassword pw)
throws Exception
- Initializes the SMTP session.
- Parameters:
server - the SMTP serverport - the SMTP portuseTLS - whether to use TLStimeout - the timeoutrequiresAuth - whether authentication is requireduser - the SMTP userpw - the SMTP password
- Throws:
Exception - if initialization fails
sendMail
public abstract boolean sendMail(Email email)
throws Exception
- Sends an email.
- Parameters:
email - the email to send
- Returns:
- true if successfully sent
- Throws:
Exception - in case of invalid internet addresses or messaging problem
Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.