|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.mail.Service
javax.mail.Transport
gnu.mail.providers.smtp.SMTPTransport
public class SMTPTransport
This transport handles communications with an SMTP server.
Field Summary | |
---|---|
protected SMTPConnection |
connection
The connection used to communicate with the server. |
protected java.lang.String |
localHostName
|
Fields inherited from class javax.mail.Service |
---|
debug, session, url |
Constructor Summary | |
---|---|
SMTPTransport(Session session,
URLName urlName)
Creates a new SMTPTransport instance. |
Method Summary | |
---|---|
void |
close()
Close this transport. |
java.lang.String |
getGreeting()
Returns the greeting banner. |
protected boolean |
protocolConnect(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
Connects to the SMTP server. |
void |
sendMessage(Message message,
Address[] addresses)
Send the specified message to the server. |
Methods inherited from class javax.mail.Transport |
---|
addTransportListener, notifyTransportListeners, removeTransportListener, send, send |
Methods inherited from class javax.mail.Service |
---|
addConnectionListener, connect, connect, connect, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected SMTPConnection connection
protected java.lang.String localHostName
Constructor Detail |
---|
public SMTPTransport(Session session, URLName urlName)
SMTPTransport
instance.
session
- a Session
valueurlName
- an URLName
valueMethod Detail |
---|
protected boolean protocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password) throws MessagingException
protocolConnect
in class Service
host
- the name of the host to connect toport
- the port to use (-1 for the default port)username
- the usernamepassword
- the password
AuthenticationFailedException
- on authentication failure
MessagingException
- for non-authentication failurespublic java.lang.String getGreeting() throws MessagingException
MessagingException
public void sendMessage(Message message, Address[] addresses) throws MessagingException, SendFailedException
sendMessage
in class Transport
message
- 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 close() throws MessagingException
close
in class Service
MessagingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |