public class DefaultTransport extends Object implements MailTransport
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ALTERNATIVE |
protected static String |
CONTENT_TRANSFER_ENCODING |
protected boolean |
debug |
protected boolean |
disableSend |
static String |
HOST |
protected static String |
MIXED |
protected Properties |
p |
static String |
PORT |
protected javax.mail.Session |
session |
protected static String |
TEXT_HTML |
protected static String |
UTF_8 |
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultTransport() |
|
DefaultTransport(Properties props) |
|
DefaultTransport(Properties props,
String user,
String password) |
|
DefaultTransport(javax.mail.Session session) |
|
DefaultTransport(String host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
protected javax.mail.Message |
buildMessage(Mail mail) |
protected javax.mail.Message |
buildMessage(javax.mail.Message mimeMessage,
Mail mail) |
Mail |
createMail()
Creates and returns a new
Mail. |
void |
disableSend() |
String |
getMailAsString(Mail mail)
|
boolean |
isDebug() |
boolean |
isDisableSend()
Checks whether this
MailTransport is disabled. |
void |
send(Mail mail)
Send the given
Mail. |
protected void |
send(Mail mail,
Collection<String> invalidAdresses) |
void |
setDebug(boolean debug) |
void |
setDisableSend(boolean disableSend)
Enable/disable sending for this
MailTransport. |
javax.mail.Address |
toAddress(Address address) |
protected static final String TEXT_HTML
protected static final String CONTENT_TRANSFER_ENCODING
protected static final String UTF_8
protected static final String MIXED
protected static final String ALTERNATIVE
public static final String HOST
public static final String PORT
protected javax.mail.Session session
protected Properties p
protected boolean disableSend
protected boolean debug
protected DefaultTransport()
public DefaultTransport(javax.mail.Session session)
public DefaultTransport(String host, int port)
public DefaultTransport(Properties props)
public DefaultTransport(Properties props, String user, String password)
public Mail createMail()
MailTransportMail.createMail in interface MailTransportMailpublic void send(Mail mail) throws MailException
MailTransportMail.send in interface MailTransportmail - the Mail to sendMailException - if an error occurs while sending the Mailpublic String getMailAsString(Mail mail)
MailTransportMail.Mail may contain sensitive informations like passwords!getMailAsString in interface MailTransportmail - the Mail to get the string-representation forString representation the Mailprotected void send(Mail mail, Collection<String> invalidAdresses) throws MailException
MailExceptionprotected javax.mail.Message buildMessage(Mail mail) throws MailException
MailExceptionprotected javax.mail.Message buildMessage(javax.mail.Message mimeMessage,
Mail mail)
throws MailException
MailExceptionpublic void disableSend()
public boolean isDisableSend()
MailTransportMailTransport is disabled.isDisableSend in interface MailTransporttrue if this MailTransport is disabled, false otherwise.public void setDisableSend(boolean disableSend)
MailTransportMailTransport. If set to true, Mails will be logged
instead of being send.setDisableSend in interface MailTransportpublic boolean isDebug()
public void setDebug(boolean debug)
public javax.mail.Address toAddress(Address address) throws UnsupportedEncodingException
UnsupportedEncodingExceptionCopyright © 2011–2021 aiticon GmbH. All rights reserved.