javax.mail
public abstract class Transport extends Service
| Constructor Summary | |
|---|---|
| Transport(Session session, URLName name)
Constructor taking Session and URLName parameters required for Service.
| |
| Method Summary | |
|---|---|
| void | addTransportListener(TransportListener listener) |
| protected void | notifyTransportListeners(int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message message) |
| void | removeTransportListener(TransportListener listener) |
| static void | send(Message message)
Send a message to all recipient addresses it contains (as returned by getAllRecipients)
using message transports appropriate for each address. |
| static void | send(Message message, Address[] addresses)
Send a message to all addresses provided irrespective of any recipients contained in the message itself
using message transports appropriate for each address. |
| abstract void | sendMessage(Message message, Address[] addresses)
Send a message to the supplied addresses using this transport; if any of the addresses are
invalid then a SendFailedException is thrown. |
Parameters: session the Session this transport is for name the location this transport is for
Parameters: message the message to send
Throws: MessagingException if there was a problem sending the message
Parameters: message the message to send addresses the addesses to send to
Throws: MessagingException if there was a problem sending the message
(Message, Address[]) method, saveChanges is
not called. A TransportEvent will be sent to registered listeners once the delivery
attempt has been made.
Parameters: message the message to send addresses list of addresses to send it to
Throws: SendFailedException if the send failed MessagingException if there was a problem sending the message