public class EmailDefinition
extends java.lang.Object
implements java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
private java.util.List<AttachmentDescriptor> |
attachments
List of attachment descriptors.
|
private java.util.List<java.lang.String> |
bcc
List of BCC addresses.
|
private java.util.List<java.lang.String> |
cc
List of CC addresses.
|
ConnectionSecurity |
connectType
Type of connection security.
|
boolean |
debug
Flag to enable debug output to the console.
|
private java.util.List<EmbedDescriptor> |
embeds
List of embedded image descriptors.
|
java.lang.String |
from
FROM address.
|
java.lang.String |
host
Host name or IP address of the SMTP server.
|
java.lang.String |
html
HTML body content.
|
java.lang.String |
password
Password for authentication.
|
java.lang.String |
port
TCP port for the SMTP server.
|
java.lang.String |
replyTo
REPLY-TO address.
|
java.lang.String |
subject
Subject line.
|
java.lang.String |
text
Plain text body content.
|
private java.util.List<java.lang.String> |
to
List of TO addresses.
|
java.lang.String |
userid
Userid for authentication.
|
boolean |
validate
Flag to determine if the server's SSL certificate is checked for validity.
|
Constructor and Description |
---|
EmailDefinition()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addBcc(java.lang.String addr)
Add the given address to the list of BCC addresses.
|
void |
addBcc(java.lang.String[] addrs)
Add the given addresses to the list of BCC addresses.
|
void |
addCc(java.lang.String addr)
Add the given address to the list of CC addresses.
|
void |
addCc(java.lang.String[] addrs)
Add the given addresses to the list of CC addresses.
|
void |
addTo(java.lang.String addr)
Add the given address to the list of TO addresses.
|
void |
addTo(java.lang.String[] addrs)
Add the given addresses to the list of TO addresses.
|
void |
attachFile(java.lang.String filename)
Add the given filename to the list of attachments.
|
void |
attachURL(java.lang.String url)
Add the given URL to the list of attachments.
|
void |
clearAttachmentsList()
Clear the current list of all attachments.
|
void |
clearBccList()
Clear the current list of all BCC addresses.
|
void |
clearCcList()
Clear the current list of all CC addresses.
|
void |
clearEmbedsList()
Clear the current list of all embedded images.
|
void |
clearToList()
Clear the current list of all TO addresses.
|
java.lang.String |
embedFile(java.lang.String filename)
Add the given filename to the list of embedded images.
|
java.lang.String |
embedURL(java.lang.String url,
java.lang.String name)
Add the given URL to the list of embedded images.
|
AttachmentDescriptor[] |
getAttachmentsList()
Obtain the current list of all attachments.
|
java.lang.String[] |
getBccList()
Obtain the current list of all BCC addresses.
|
java.lang.String[] |
getCcList()
Obtain the current list of all CC addresses.
|
EmbedDescriptor[] |
getEmbedsList()
Obtain the current list of all embedded images.
|
java.lang.String[] |
getToList()
Obtain the current list of all TO addresses.
|
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
public ConnectionSecurity connectType
public java.lang.String host
null
.public java.lang.String port
null
, the default port will be used.public java.lang.String userid
null
,
authentication will be disabled.public java.lang.String password
null
,
authentication will be disabled.public boolean validate
false
, the hostname
of the SMTP server will be defined as trusted AND validity checking will be disabled.public boolean debug
public java.lang.String from
public java.lang.String replyTo
public java.lang.String subject
public java.lang.String text
public java.lang.String html
private java.util.List<java.lang.String> to
private java.util.List<java.lang.String> cc
private java.util.List<java.lang.String> bcc
private java.util.List<AttachmentDescriptor> attachments
private java.util.List<EmbedDescriptor> embeds
public void addTo(java.lang.String addr)
addr
- The TO address to add.public void addTo(java.lang.String[] addrs)
addrs
- The list of TO addresses to add.public java.lang.String[] getToList()
public void clearToList()
public void addCc(java.lang.String addr)
addr
- The CC address to add.public void addCc(java.lang.String[] addrs)
addrs
- The list of CC addresses to add.public java.lang.String[] getCcList()
public void clearCcList()
public void addBcc(java.lang.String addr)
addr
- The BCC address to add.public void addBcc(java.lang.String[] addrs)
addrs
- The list of BCC addresses to add.public java.lang.String[] getBccList()
public void clearBccList()
public void attachFile(java.lang.String filename)
filename
- The filename of the resource to attach.public void attachURL(java.lang.String url)
url
- The URL of the resource to attach.public AttachmentDescriptor[] getAttachmentsList()
public void clearAttachmentsList()
public java.lang.String embedFile(java.lang.String filename)
filename
- The filename of the resource to attach.null
if there was an error.public java.lang.String embedURL(java.lang.String url, java.lang.String name)
url
- The URL of the resource to attach.name
- The name of the resource. This may not be null
and it cannot be
an empty string.null
if there was an error.public EmbedDescriptor[] getEmbedsList()
public void clearEmbedsList()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The input source from which fields will be restored.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If payload can't be instantiated.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which fields will be saved.java.io.IOException
- In case of I/O errors.