Package adams.core.net
Class Email
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.net.Email
-
- All Implemented Interfaces:
LoggingSupporter,SizeOfHandler,Serializable
public class Email extends LoggingObject
Container object for an email.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected File[]m_Attachmentsthe attachments.protected EmailAddress[]m_BCCthe BCC recipients.protected Stringm_Bodythe body.protected EmailAddress[]m_CCthe CC recipients.protected EmailAddressm_Fromthe sender.protected Stringm_Subjectthe subject.protected EmailAddress[]m_Tothe recipients.static StringNO_SUBJECTthe default subject if none provided.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description Email(EmailAddress from, EmailAddress[] to, EmailAddress[] cc, EmailAddress[] bcc, String subject, String body, File[] attachments)Initializes the email.Email(EmailAddress from, EmailAddress[] to, String subject, String body, File[] attachments)Initializes the email.Email(EmailAddress from, EmailAddress to, String subject, String body)Initializes the email.Email(EmailAddress from, EmailAddress to, String subject, String body, File[] attachments)Initializes the email.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File[]getAttachments()Returns the attachments.EmailAddress[]getBCC()Returns the BCC recipients.StringgetBody()Returns the body.EmailAddress[]getCC()Returns the CC recipients.EmailAddressgetFrom()Returns the sender.StringgetSubject()Returns the subject.EmailAddress[]getTo()Returns the TO recipients.StringtoPlainText()StringtoString()Simple info string for debugging purposes.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
NO_SUBJECT
public static final String NO_SUBJECT
the default subject if none provided.- See Also:
- Constant Field Values
-
m_From
protected EmailAddress m_From
the sender.
-
m_To
protected EmailAddress[] m_To
the recipients.
-
m_CC
protected EmailAddress[] m_CC
the CC recipients.
-
m_BCC
protected EmailAddress[] m_BCC
the BCC recipients.
-
m_Subject
protected String m_Subject
the subject.
-
m_Body
protected String m_Body
the body.
-
m_Attachments
protected File[] m_Attachments
the attachments.
-
-
Constructor Detail
-
Email
public Email(EmailAddress from, EmailAddress to, String subject, String body)
Initializes the email.- Parameters:
from- the senderto- the recipientsubject- the subjectbody- the content
-
Email
public Email(EmailAddress from, EmailAddress to, String subject, String body, File[] attachments)
Initializes the email.- Parameters:
from- the senderto- the recipientsubject- the subjectbody- the contentattachments- the attachments
-
Email
public Email(EmailAddress from, EmailAddress[] to, String subject, String body, File[] attachments)
Initializes the email.- Parameters:
from- the senderto- the recipientssubject- the subjectbody- the contentattachments- the attachments
-
Email
public Email(EmailAddress from, EmailAddress[] to, EmailAddress[] cc, EmailAddress[] bcc, String subject, String body, File[] attachments)
Initializes the email.- Parameters:
from- the senderto- the recipientscc- the CC recipientsbcc- the BCC recipientssubject- the subjectbody- the contentattachments- the attachments
-
-
Method Detail
-
getFrom
public EmailAddress getFrom()
Returns the sender.- Returns:
- the sender
-
getTo
public EmailAddress[] getTo()
Returns the TO recipients.- Returns:
- the recipients
-
getCC
public EmailAddress[] getCC()
Returns the CC recipients.- Returns:
- the recipients
-
getBCC
public EmailAddress[] getBCC()
Returns the BCC recipients.- Returns:
- the recipients
-
getAttachments
public File[] getAttachments()
Returns the attachments.- Returns:
- the attachments
-
getSubject
public String getSubject()
Returns the subject.- Returns:
- the subject
-
getBody
public String getBody()
Returns the body.- Returns:
- the body
-
toString
public String toString()
Simple info string for debugging purposes.
-
toPlainText
public String toPlainText()
-
-