Class SMTPEnvelope
java.lang.Object
org.deltava.mail.SMTPEnvelope
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<NotificationEnvelope<?>>,NotificationEnvelope<Address>
A bean to aggregate SMTP message information.
- Since:
- 1.0
- Version:
- 11.1
- Author:
- Luke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.deltava.beans.NotificationEnvelope
NotificationEnvelope.Protocol -
Constructor Summary
ConstructorsConstructorDescriptionSMTPEnvelope(boolean isOurDomain, EMailAddress from) Creates a new STMP envelope. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCopyTo(EMailAddress addr) Adds an address to the copy-to list.voidAdds a header to the message.voidaddRecipient(EMailAddress addr) Adds an address to the recipient list.voidaddRecipients(Collection<EMailAddress> addrs) Adds a Collection of addresses to the recipient list.voidClears the list of recipients.clone()Clones this SMTP envelope.javax.activation.DataSourceReturns the envelope's attachment, if any.getBody()Returns the message body.Returns the message content type.Address[]Returns the copy-to recipient list.Returns the envelope creation date.Returns the destination address.getFrom()Returns the originator of this e-mail message.Returns the message headers.Returns this envelope's notification protocol.Address[]Returns the recipient list.Returns the message subject.inthashCode()booleanReturns if the envelope has any recipients.booleanReturns whether this envelope originates from our e-mail domain, or is spoofing another domain.voidsetAttachment(javax.activation.DataSource ds) Adds an attachment to the envelope.voidSets the message body.voidsetContentType(String cType) Sets the message content type.voidsetRecipient(EMailAddress addr) Clears the recipient list and overwrites it with a single address.voidsetSubject(String subj) Sets the message subject.toString()Methods inherited from class java.lang.Object
equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.deltava.beans.NotificationEnvelope
compareTo
-
Constructor Details
-
SMTPEnvelope
SMTPEnvelope(boolean isOurDomain, EMailAddress from) Creates a new STMP envelope.- Parameters:
isOurDomain- TRUE if from an SES-validated domain, otheriwse FALSEfrom- the originating address
-
-
Method Details
-
getAttachment
public javax.activation.DataSource getAttachment()Returns the envelope's attachment, if any.- Returns:
- a Java Activation data source, or null
- See Also:
-
getBody
-
getCreatedOn
Description copied from interface:NotificationEnvelopeReturns the envelope creation date.- Specified by:
getCreatedOnin interfaceNotificationEnvelope<Address>- Returns:
- the creation date/time
-
getProtocol
Description copied from interface:NotificationEnvelopeReturns this envelope's notification protocol.- Specified by:
getProtocolin interfaceNotificationEnvelope<Address>- Returns:
- the Protocol
-
getSubject
-
getContentType
-
getFrom
Returns the originator of this e-mail message.- Returns:
- the originating address
-
getCopyTo
Returns the copy-to recipient list.- Returns:
- an array of Address beans, or null if empty
- See Also:
-
getRecipients
Returns the recipient list.- Returns:
- an array of Address beans
- See Also:
-
getEndpoint
Description copied from interface:NotificationEnvelopeReturns the destination address.- Specified by:
getEndpointin interfaceNotificationEnvelope<Address>- Returns:
- the address
-
getHeaders
-
hasRecipients
public boolean hasRecipients()Returns if the envelope has any recipients.- Returns:
- TRUE if receipients or copyTo are not empty, otherwise FALSE
- See Also:
-
isOurDomain
public boolean isOurDomain()Returns whether this envelope originates from our e-mail domain, or is spoofing another domain.- Returns:
- TRUE if created using a validated SES domain, otherwise FALSE
-
setAttachment
public void setAttachment(javax.activation.DataSource ds) Adds an attachment to the envelope.- Parameters:
ds- a Java Activation data source- See Also:
-
setBody
-
setSubject
Sets the message subject.- Parameters:
subj- the subject- See Also:
-
setContentType
Sets the message content type.- Parameters:
cType- the MIME type- See Also:
-
addRecipient
Adds an address to the recipient list.- Parameters:
addr- the e-mail address- See Also:
-
addHeader
-
setRecipient
Clears the recipient list and overwrites it with a single address.- Parameters:
addr- the e-mail address- See Also:
-
addRecipients
Adds a Collection of addresses to the recipient list.- Parameters:
addrs- a Collection of EMailAddress beans- See Also:
-
addCopyTo
Adds an address to the copy-to list.- Parameters:
addr- the e-mail address- See Also:
-
clearRecipients
public void clearRecipients()Clears the list of recipients. -
clone
-
hashCode
-
toString
-