Package adams.core.net
Interface SendEmail
-
- All Superinterfaces:
CleanUpHandler,Destroyable,OptionHandler
- All Known Subinterfaces:
InMemorySendEmail
- All Known Implementing Classes:
AbstractSendEmail,ApacheSendEmail,JavaMailSendEmail,SimpleApacheSendEmail
public interface SendEmail extends OptionHandler, CleanUpHandler
Interface for classes that can send emails.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidinitializeSmtpSession(String server, int port, boolean useTLS, boolean useSSL, int timeout, boolean requiresAuth, String user, BasePassword pw, String protocols)Initializes the SMTP session.booleanrequiresSmtpSessionInitialization()Returns whether the SMTP session needs to be initialized.booleansendMail(Email email)Sends an email.-
Methods inherited from interface adams.core.CleanUpHandler
cleanUp
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, defineOptions, getOptionManager, toCommandLine
-
-
-
-
Method Detail
-
requiresSmtpSessionInitialization
boolean requiresSmtpSessionInitialization()
Returns whether the SMTP session needs to be initialized.- Returns:
- true if the SMTP session needs to be initialized
-
initializeSmtpSession
void initializeSmtpSession(String server, int port, boolean useTLS, boolean useSSL, int timeout, boolean requiresAuth, String user, BasePassword pw, String protocols) throws Exception
Initializes the SMTP session.- Parameters:
server- the SMTP serverport- the SMTP portuseTLS- whether to use TLSuseSSL- whether to use SSLtimeout- the timeoutrequiresAuth- whether authentication is requireduser- the SMTP userpw- the SMTP passwordprotocols- the protocols to use, empty for default- Throws:
Exception- if initialization fails
-
-