public class SMTPTransport extends Transport
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
starttls |
| Modifier | Constructor and Description |
|---|---|
protected |
SMTPTransport(MailSession session) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this service and terminate its connection.
|
void |
connect()
A generic connect method that takes no parameters.
|
void |
connect(Socket connection) |
void |
connect(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password) |
protected boolean |
ehlo() |
boolean |
getRequireStartTLS() |
void |
issueCommand(java.lang.String cmd,
int expect) |
protected void |
protocolConnect(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password) |
protected int |
readServerResponse() |
void |
sendMessage(Message message) |
protected int |
simpleCommand(byte[] command) |
int |
simpleCommand(java.lang.String command) |
protected void |
startTLS()
Issue the STARTTLS command and switch the socket to TLS mode if it succeeds.
|
boolean |
supportsExtension(java.lang.String ext) |
protected static final java.lang.String starttls
protected SMTPTransport(MailSession session)
protected void protocolConnect(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password)
throws AuthenticationException,
MessagingException
protocolConnect in class ServiceAuthenticationExceptionMessagingExceptionpublic void sendMessage(Message message) throws MessagingException
sendMessage in class TransportMessagingExceptionprotected boolean ehlo()
throws MessagingException
MessagingExceptionpublic void connect(Socket connection) throws MessagingException
MessagingExceptionprotected int readServerResponse()
throws MessagingException
MessagingExceptionpublic void issueCommand(java.lang.String cmd,
int expect)
throws MessagingException
MessagingExceptionprotected int simpleCommand(byte[] command)
throws MessagingException
MessagingExceptionpublic int simpleCommand(java.lang.String command)
throws MessagingException
MessagingExceptionpublic boolean supportsExtension(java.lang.String ext)
public boolean getRequireStartTLS()
public void connect()
throws AuthenticationException,
MessagingException
Serviceconnect in class ServiceAuthenticationExceptionMessagingExceptionpublic void close()
throws MessagingException
Serviceclose in class ServiceMessagingExceptionpublic void connect(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password)
throws AuthenticationException,
MessagingException
connect in class ServiceAuthenticationExceptionMessagingExceptionprotected void startTLS()
throws MessagingException
MessagingException