public class SMTPTransport extends Transport
| Modifier and Type | Field | Description |
|---|---|---|
protected org.jpackage.mail.inet.smtp.SMTPConnection |
connection |
The connection used to communicate with the server.
|
protected java.lang.String |
localHostName |
| Constructor | Description |
|---|---|
SMTPTransport(Session session,
URLName urlName) |
Creates a new
SMTPTransport instance. |
| Modifier and Type | Method | Description |
|---|---|---|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddConnectionListener, connect, connect, connect, connect, getURLName, isConnected, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toStringaddTransportListener, notifyTransportListeners, removeTransportListener, send, sendprotected org.jpackage.mail.inet.smtp.SMTPConnection connection
protected java.lang.String localHostName
protected boolean protocolConnect(java.lang.String host,
int port,
java.lang.String username,
java.lang.String password)
throws MessagingException
protocolConnect in class Servicehost - the name of the host to connect toport - the port to use (-1 for the default port)username - the usernamepassword - the passwordAuthenticationFailedException - on authentication failureMessagingException - for non-authentication failurespublic java.lang.String getGreeting()
throws MessagingException
MessagingExceptionpublic void sendMessage(Message message, Address[] addresses) throws MessagingException, SendFailedException
sendMessage in class Transportmessage - the message to be sentaddresses - the addresses to send this message toSendFailedException - if the send failed because of
invalid addressesMessagingException - if the transport is not connectedpublic void close()
throws MessagingException
close in class ServiceMessagingException© Copyright 2003, 2004 The Free Software Foundation, All rights reserved