|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.mail.Service
javax.mail.Transport
public abstract class Transport
A message transport mechanism that can be used to deliver messages.
Field Summary |
---|
Fields inherited from class javax.mail.Service |
---|
debug, session, url |
Constructor Summary | |
---|---|
Transport(Session session,
URLName url)
Constructor. |
Method Summary | |
---|---|
void |
addTransportListener(TransportListener l)
Adds a listener for transport events. |
protected void |
notifyTransportListeners(int type,
Address[] validSent,
Address[] validUnsent,
Address[] invalid,
Message msg)
Notifies all transport listeners. |
void |
removeTransportListener(TransportListener l)
Removes a transport event listener. |
static void |
send(Message msg)
Sends the specified message. |
static void |
send(Message msg,
Address[] addresses)
Sends the message to the specified addresses, ignoring any recipients specified in the message itself. |
abstract void |
sendMessage(Message msg,
Address[] addresses)
Sends the message to the specified list of addresses. |
Methods inherited from class javax.mail.Service |
---|
addConnectionListener, close, connect, connect, connect, getURLName, isConnected, notifyConnectionListeners, protocolConnect, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Transport(Session session, URLName url)
session
- the session context for this transporturl
- a URLName to be used for this transportMethod Detail |
---|
public static void send(Message msg) throws MessagingException
javamail.address.map
resource).
msg
- the message to send
SendFailedException
- if the message could not be sent to
some or any of the recipients
MessagingException
public static void send(Message msg, Address[] addresses) throws MessagingException
msg
- the message to sendaddresses
- the addresses to which to send the message
SendFailedException
- if the message could not be sent to
some or any of the recipients
MessagingException
public abstract void sendMessage(Message msg, Address[] addresses) throws MessagingException
msg
- the message to be sentaddresses
- the addresses to send this message to
SendFailedException
- if the send failed because of
invalid addresses
MessagingException
- if the transport is not connectedpublic void addTransportListener(TransportListener l)
public void removeTransportListener(TransportListener l)
protected void notifyTransportListeners(int type, Address[] validSent, Address[] validUnsent, Address[] invalid, Message msg)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |