|
||||||||||
| 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 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. |
String |
getGreeting()
Returns the greeting banner. |
protected boolean |
protocolConnect(String host,
int port,
String username,
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, 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 String localHostName
| Constructor Detail |
|---|
public SMTPTransport(Session session,
URLName urlName)
SMTPTransport instance.
session - a Session valueurlName - an URLName value| Method Detail |
|---|
protected boolean protocolConnect(String host,
int port,
String username,
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 password
AuthenticationFailedException - on authentication failure
MessagingException - for non-authentication failures
public String getGreeting()
throws MessagingException
MessagingException
public void sendMessage(Message message,
Address[] addresses)
throws MessagingException,
SendFailedException
sendMessage in class Transportmessage - 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 connected
public void close()
throws MessagingException
close in class ServiceMessagingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||