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 Service
AuthenticationException
MessagingException
public void sendMessage(Message message) throws MessagingException
sendMessage
in class Transport
MessagingException
protected boolean ehlo() throws MessagingException
MessagingException
public void connect(Socket connection) throws MessagingException
MessagingException
protected int readServerResponse() throws MessagingException
MessagingException
public void issueCommand(java.lang.String cmd, int expect) throws MessagingException
MessagingException
protected int simpleCommand(byte[] command) throws MessagingException
MessagingException
public int simpleCommand(java.lang.String command) throws MessagingException
MessagingException
public boolean supportsExtension(java.lang.String ext)
public boolean getRequireStartTLS()
public void connect() throws AuthenticationException, MessagingException
Service
connect
in class Service
AuthenticationException
MessagingException
public void close() throws MessagingException
Service
close
in class Service
MessagingException
public void connect(java.lang.String host, int port, java.lang.String user, java.lang.String password) throws AuthenticationException, MessagingException
connect
in class Service
AuthenticationException
MessagingException
protected void startTLS() throws MessagingException
MessagingException