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_Attachments
the attachments.protected EmailAddress[]
m_BCC
the BCC recipients.protected String
m_Body
the body.protected EmailAddress[]
m_CC
the CC recipients.protected EmailAddress
m_From
the sender.protected String
m_Subject
the subject.protected EmailAddress[]
m_To
the recipients.static String
NO_SUBJECT
the 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.String
getBody()
Returns the body.EmailAddress[]
getCC()
Returns the CC recipients.EmailAddress
getFrom()
Returns the sender.String
getSubject()
Returns the subject.EmailAddress[]
getTo()
Returns the TO recipients.String
toPlainText()
String
toString()
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()
-
-