|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.transport.MailTransport
public abstract class MailTransport
MailTransport - Provides operations related to a mail transport.
| Constructor Summary | |
|---|---|
MailTransport()
|
|
| Method Summary | |
|---|---|
abstract void |
close()
Closes this mail transport |
static MailTransport |
getInstance(com.openexchange.session.Session session)
Gets the proper instance of mail transport parameterized with given session. |
static MailTransport |
getInstance(com.openexchange.session.Session session,
int accountId)
Gets the proper instance of mail transport for session user's default transport account. |
abstract TransportConfig |
getTransportConfig()
Returns the transport configuration appropriate for current user. |
abstract void |
ping()
Pings the transport server to check if a connection can be established. |
MailMessage |
sendMailMessage(ComposedMailMessage transportMail,
ComposeType sendType)
Sends a mail message This is a convenience method that invokes sendMailMessage(ComposedMailMessage, ComposeType, Address[]) with the latter
parameter set to null if ComposedMailMessage.hasRecipients() is false; otherwise
ComposedMailMessage.getRecipients() is passed. |
abstract MailMessage |
sendMailMessage(ComposedMailMessage transportMail,
ComposeType sendType,
javax.mail.Address[] allRecipients)
Sends a mail message |
MailMessage |
sendRawMessage(byte[] asciiBytes)
Sends specified message's raw ascii bytes. |
abstract MailMessage |
sendRawMessage(byte[] asciiBytes,
javax.mail.Address[] allRecipients)
Sends specified message's raw ascii bytes. |
abstract void |
sendReceiptAck(MailMessage srcMail,
java.lang.String fromAddr)
Sends a receipt acknowledgment for the specified message. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MailTransport()
| Method Detail |
|---|
public static final MailTransport getInstance(com.openexchange.session.Session session)
throws MailException
mail transport parameterized with given session.
Note: Don't forget to call final close() on obtained mail transport:
final MailTransport mailTransport = MailTransport.getInstance(session);
try {
// Do something
} finally {
mailTransport.close();
}
session - The session
MailTransport
MailException - If instantiation fails
public static final MailTransport getInstance(com.openexchange.session.Session session,
int accountId)
throws MailException
mail transport for session user's default transport account.
Note: Don't forget to call final close() on obtained mail transport:
final MailTransport mailTransport = MailTransport.getInstance(session, accountId);
try {
// Do something
} finally {
mailTransport.close();
}
session - The session
MailTransport
MailException - If instantiation fails
public MailMessage sendMailMessage(ComposedMailMessage transportMail,
ComposeType sendType)
throws MailException
This is a convenience method that invokes sendMailMessage(ComposedMailMessage, ComposeType, Address[]) with the latter
parameter set to null if ComposedMailMessage.hasRecipients() is false; otherwise
ComposedMailMessage.getRecipients() is passed.
transportMail - The mail message to send (containing necessary header data and body)sendType - The send type
MailException - If transport fails
public abstract MailMessage sendMailMessage(ComposedMailMessage transportMail,
ComposeType sendType,
javax.mail.Address[] allRecipients)
throws MailException
transportMail - The mail message to send (containing necessary header data and body)sendType - The send typeallRecipients - An array of addresses to send this message to; may be null to extract recipients
from message headers TO, CC, BCC, and NEWSGROUPS.
MailException - If transport fails
public MailMessage sendRawMessage(byte[] asciiBytes)
throws MailException
This is a convenience method that invokes sendRawMessage(byte[], Address[]) with the latter parameter set to
null.
asciiBytes - The raw ascii bytes
MailException - If sending fails
public abstract MailMessage sendRawMessage(byte[] asciiBytes,
javax.mail.Address[] allRecipients)
throws MailException
asciiBytes - The raw ascii bytesallRecipients - An array of addresses to send this message to; may be null to extract recipients
from message headers TO, CC, BCC, and NEWSGROUPS.
MailException - If sending fails
public abstract void sendReceiptAck(MailMessage srcMail,
java.lang.String fromAddr)
throws MailException
srcMail - The source mailfromAddr - The from address (as unicode string). If set to null, user's default email address is used as value for
header From
MailException - If transport fails
public abstract void ping()
throws MailException
MailException - If the ping fails
public abstract void close()
throws MailException
MailException - If closing fails
public abstract TransportConfig getTransportConfig()
throws MailException
MailException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||