|
||||||||||
| 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.JavaMailSendEmail
public class JavaMailSendEmail
Uses JavaMail for sending emails.
EmailHelper#initializeSmtpSession(String, int, boolean, int, boolean, String, BasePassword),
EmailHelper#sendMail(Session, String, String[], String[], String[], String, String, File[]),
Serialized Form| Field Summary | |
|---|---|
static String |
KEY_SMTPAUTH
the system-wide property for SMTP Auth. |
static String |
KEY_SMTPHOST
the system-wide property for the SMTP host. |
static String |
KEY_SMTPPORT
the system-wide property for the SMTP port. |
static String |
KEY_SMTPTIMEOUT
the system-wide property for SMTP timeout. |
static String |
KEY_STARTTLS
the system-wide property for StartTLS. |
protected javax.mail.Session |
m_Session
the SMTP session object. |
| Fields inherited from class adams.core.option.AbstractOptionHandler |
|---|
m_DebugLevel, m_OptionManager |
| Constructor Summary | |
|---|---|
JavaMailSendEmail()
|
|
| 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. |
protected javax.mail.internet.MimeMessage |
newMessage(EmailAddress fromAddress,
EmailAddress[] toAddress,
EmailAddress[] ccAddress,
EmailAddress[] bccAddress,
String subject)
Creates a new email message. |
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 |
|---|
public static final String KEY_SMTPHOST
public static final String KEY_SMTPPORT
public static final String KEY_STARTTLS
public static final String KEY_SMTPAUTH
public static final String KEY_SMTPTIMEOUT
protected transient javax.mail.Session m_Session
| Constructor Detail |
|---|
public JavaMailSendEmail()
| 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
protected javax.mail.internet.MimeMessage newMessage(EmailAddress fromAddress,
EmailAddress[] toAddress,
EmailAddress[] ccAddress,
EmailAddress[] bccAddress,
String subject)
throws javax.mail.internet.AddressException,
javax.mail.MessagingException
fromAddress - the sendertoAddress - the recipients, can be nullccAddress - the CC recipients, can be nullbccAddress - the BCC recipients, can be nullsubject - the subject
javax.mail.internet.AddressException - in case of invalid internet addresses
javax.mail.MessagingException - in case of a messaging problem
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 | |||||||||