core.mailservice.MailService or
base.mailservice.MailService instead.@Deprecated
public class EmailToolkit
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONNECTION_TIMEOUT
Deprecated.
The attribute key for the socket connection timeout in milliseconds.
|
static java.lang.String |
SOCKET_FACTORY
Deprecated.
The attribute key for the socket factory class.
|
static java.lang.String |
TIMEOUT
Deprecated.
The attribute key for the socket read timeout in milliseconds.
|
static java.lang.String |
WRITE_TIMEOUT
Deprecated.
The attribute key for the socket write timeout in milliseconds.
|
| Constructor and Description |
|---|
EmailToolkit()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkException(java.lang.Throwable t)
Deprecated.
If the given Throwable or one of its causes is either a
ConnectException or an UnknownHostException, this method
will return true, to indicate, that there may be a temporary problem with
sending emails and that it is worth to retry. |
static SerialisedEmail |
sendMail(java.lang.String from,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.lang.String body,
java.util.List<SerialisableAttachment> attachments,
java.lang.String hostname)
Deprecated.
This method allows the usage of a host differing from the default host.
|
static SerialisedEmail |
sendMail(java.lang.String from,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.lang.String body,
java.util.List<SerialisableAttachment> attachments,
java.lang.String hostname,
int hostport,
boolean useTLS,
boolean useSSL,
boolean overtrustful)
Deprecated.
This method allows the usage of a host differing from the default host.
|
static SerialisedEmail |
sendMail(java.lang.String from,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.lang.String body,
java.util.List<SerialisableAttachment> attachments,
java.lang.String hostname,
int hostport,
java.lang.String username,
java.lang.String password,
boolean useTLS,
boolean useSSL,
boolean overtrustful)
Deprecated.
This method allows the usage of a host differing from the default host that
also needs a username and a password.
|
static SerialisedEmail |
sendMail(java.lang.String from,
java.lang.String[] to,
java.lang.String[] cc,
java.lang.String[] bcc,
java.lang.String subject,
java.lang.String body,
java.util.List<SerialisableAttachment> attachments,
java.lang.String hostname,
int hostport,
java.lang.String username,
java.lang.String password,
boolean useTLS,
boolean useSSL,
boolean overtrustful,
java.util.Map<java.lang.String,java.lang.String> addAttributes)
Deprecated.
This method allows the usage of a host differing from the default host that
also needs a username and a password.
|
public static final java.lang.String CONNECTION_TIMEOUT
public static final java.lang.String TIMEOUT
public static final java.lang.String WRITE_TIMEOUT
public static final java.lang.String SOCKET_FACTORY
public static SerialisedEmail sendMail(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body, java.util.List<SerialisableAttachment> attachments, java.lang.String hostname)
from - The e-mail-address of the sender of the message. If NULL is
provided a system default sender will be used.to - The list of addresses the e-mail should be sent to. At least one
recipient has to be provided.cc - The list of addresses the e-mail should be sent to as 'CC'. NULL
is interpreted as no further recipients.bcc - The list of addresses the e-mail should be sent to as 'BCC'.
NULL is interpreted as no further recipients.subject - The subject of the e-mail.body - The body text of the e-mail.attachments - The attachments for the e-mail. null will be
accepted as no attachments.hostname - The hostname of the mail system the e-mail should be sent
via. If null is provided a system default host will be
used.InternalServiceException - If an error occurs during creating, sending or serialising the
e-mail, an InternalServiceException will be thrownpublic static SerialisedEmail sendMail(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body, java.util.List<SerialisableAttachment> attachments, java.lang.String hostname, int hostport, boolean useTLS, boolean useSSL, boolean overtrustful)
from - The e-mail-address of the sender of the message. If NULL is
provided a system default sender will be used.to - The list of addresses the e-mail should be sent to. At least one
recipient has to be provided.cc - The list of addresses the e-mail should be sent to as 'CC'. NULL
is interpreted as no further recipients.bcc - The list of addresses the e-mail should be sent to as 'BCC'.
NULL is interpreted as no further recipients.subject - The subject of the e-mail.body - The body text of the e-mail.attachments - The attachments for the e-mail. NULL will be accepted as
no attachments.hostname - The hostname of the mail system the e-mail should be sent
via. If NULL is provided a system default host will be used.hostport - The smtp port of the mail system the e-mail should be sent
via. If 0 is provided the default port 25 will be used.useTLS - Whether TLS should be used.useSSL - Whether SSL encryption should be used.overtrustful - Whether every certificate will be trusted.InternalServiceException - If an error occurs during creating, sending or serialising the
e-mail, an InternalServiceException will be thrownpublic static SerialisedEmail sendMail(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body, java.util.List<SerialisableAttachment> attachments, java.lang.String hostname, int hostport, java.lang.String username, java.lang.String password, boolean useTLS, boolean useSSL, boolean overtrustful)
from - The e-mail-address of the sender of the message. If NULL is
provided a system default sender will be used.to - The list of addresses the e-mail should be sent to. At least one
recipient has to be provided.cc - The list of addresses the e-mail should be sent to as 'CC'. NULL
is interpreted as no further recipients.bcc - The list of addresses the e-mail should be sent to as 'BCC'.
NULL is interpreted as no further recipients.subject - The subject of the e-mail.body - The body text of the e-mail.attachments - The attachments for the e-mail. NULL will be accepted as
no attachments.hostname - The hostname of the mail system the e-mail should be sent
via. If NULL is provided a system default host will be used.hostport - The smtp port of the mail system the e-mail should be sent
via. If 0 is provided the default port 25 will be used.username - The username that is needed to authenticate on the
smtp-server. NULL means, that no authentication is needed.password - The password that is needed to authenticate on the
smtp-server. NULL means, that no authentication is needed.useTLS - Whether TLS should be used.useSSL - Whether SSL encryption should be used.overtrustful - Whether every certificate will be trusted.InternalServiceException - If an error occurs during creating, sending or serialising the
e-mail, an InternalServiceException will be thrownpublic static SerialisedEmail sendMail(java.lang.String from, java.lang.String[] to, java.lang.String[] cc, java.lang.String[] bcc, java.lang.String subject, java.lang.String body, java.util.List<SerialisableAttachment> attachments, java.lang.String hostname, int hostport, java.lang.String username, java.lang.String password, boolean useTLS, boolean useSSL, boolean overtrustful, java.util.Map<java.lang.String,java.lang.String> addAttributes)
NOTE: This method actually sends the e-mail.
from - The e-mail-address of the sender of the message. If NULL is
provided a system default sender will be used.to - The list of addresses the e-mail should be sent to. At least one
recipient has to be provided.cc - The list of addresses the e-mail should be sent to as 'CC'. NULL
is interpreted as no further recipients.bcc - The list of addresses the e-mail should be sent to as 'BCC'.
NULL is interpreted as no further recipients.subject - The subject of the e-mail.body - The body text of the e-mail.attachments - The attachments for the e-mail. NULL will be accepted as
no attachments.hostname - The hostname of the mail system the e-mail should be sent
via. If NULL is provided a system default host will be used.hostport - The smtp port of the mail system the e-mail should be sent
via. If 0 is provided the default port 25 will be used.username - The username that is needed to authenticate on the
smtp-server. NULL means, that no authentication is needed.password - The password that is needed to authenticate on the
smtp-server. NULL means, that no authentication is needed.useTLS - Whether TLS should be used.useSSL - Whether SSL encryption should be used.overtrustful - Whether every certificate will be trusted.addAttributes - A map of additional attributes that could be used for
the e-mail.InternalServiceException - If an error occurs during creating, sending or serialising the
e-mail, an InternalServiceException will be thrownpublic static boolean checkException(java.lang.Throwable t)
ConnectException or an UnknownHostException, this method
will return true, to indicate, that there may be a temporary problem with
sending emails and that it is worth to retry.t - The Throwable that should be checked.