/*** * A convenience method to send the SMTP HELP command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int help() throws IOException { return sendCommand(SMTPCommand.HELP); }
/*** * A convenience method to send the SMTP QUIT command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int quit() throws IOException { return sendCommand(SMTPCommand.QUIT); }
/*** * A convenience method to send the SMTP DATA command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int data() throws IOException { return sendCommand(SMTPCommand.DATA); }
/*** * A convenience method to send the SMTP TURN command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int turn() throws IOException { return sendCommand(SMTPCommand.TURN); }
/*** * A convenience method to send the SMTP VRFY command to the server, * receive the reply, and return the reply code. * <p> * @param name The name to expand. * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int expn(String name) throws IOException { return sendCommand(SMTPCommand.EXPN, name); }
/*** * A convenience method to send the SMTP NOOP command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int noop() throws IOException { return sendCommand(SMTPCommand.NOOP); }
/*** * A convenience method to send the SMTP RSET command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int rset() throws IOException { return sendCommand(SMTPCommand.RSET); }
/*** * A convenience method to send the SMTP VRFY command to the server, * receive the reply, and return the reply code. * <p> * @param user The user address to verify. * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int vrfy(String user) throws IOException { return sendCommand(SMTPCommand.VRFY, user); }
/*** * A convenience method to send the SMTP HELO command to the server, * receive the reply, and return the reply code. * <p> * @param hostname The hostname of the sender. * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int helo(String hostname) throws IOException { return sendCommand(SMTPCommand.HELO, hostname); }
/*** * A convenience method to send the SMTP SAML command to the server, * receive the reply, and return the reply code. * <p> * @param reversePath The reverese path. * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int saml(String reversePath) throws IOException { return sendCommand(SMTPCommand.SAML, reversePath); }
/*** * A convenience method to send the SMTP HELP command to the server, * receive the reply, and return the reply code. * <p> * @param command The command name on which to request help. * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int help(String command) throws IOException { return sendCommand(SMTPCommand.HELP, command); }
/*** * A convenience method to send the SMTP SEND command to the server, * receive the reply, and return the reply code. * <p> * @param reversePath The reverese path. * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int send(String reversePath) throws IOException { return sendCommand(SMTPCommand.SEND, reversePath); }
/*** * A convenience method to send the SMTP SOML command to the server, * receive the reply, and return the reply code. * <p> * @param reversePath The reverese path. * @return The reply code received from the server. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int soml(String reversePath) throws IOException { return sendCommand(SMTPCommand.SOML, reversePath); }
/*** * Sends an SMTP command with no arguments to the server, waits for a * reply and returns the numerical response code. After invocation, for * more detailed information, the actual reply text can be accessed by * calling {@link #getReplyString getReplyString } or * {@link #getReplyStrings getReplyStrings }. * <p> * @param command The SMTPCommand constant corresponding to the SMTP command * to send. * @return The integer value of the SMTP reply code returned by the server * in response to the command. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int sendCommand(int command) throws IOException { return sendCommand(command, null); }
/*** * Sends an SMTP command with no arguments to the server, waits for a * reply and returns the numerical response code. After invocation, for * more detailed information, the actual reply text can be accessed by * calling {@link #getReplyString getReplyString } or * {@link #getReplyStrings getReplyStrings }. * <p> * @param command The text representation of the SMTP command to send. * @return The integer value of the SMTP reply code returned by the server * in response to the command. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int sendCommand(String command) throws IOException { return sendCommand(command, null); }
/*** * Sends an SMTP command to the server, waits for a reply and returns the * numerical response code. After invocation, for more detailed * information, the actual reply text can be accessed by calling * {@link #getReplyString getReplyString } or * {@link #getReplyStrings getReplyStrings }. * <p> * @param command The SMTPCommand constant corresponding to the SMTP command * to send. * @param args The arguments to the SMTP command. If this parameter is * set to null, then the command is sent with no argument. * @return The integer value of the SMTP reply code returned by the server * in response to the command. * @throws SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @throws IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int sendCommand(int command, String args) throws IOException { return sendCommand(SMTPCommand.getCommand(command), args); }
/*** * A convenience method to send the SMTP DATA command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @exception SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @exception IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int data() throws IOException { return sendCommand(SMTPCommand.DATA); }
/*** * A convenience method to send the SMTP DATA command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @exception SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @exception IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int data() throws IOException { return sendCommand(SMTPCommand.DATA); }
/*** * A convenience method to send the SMTP QUIT command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @exception SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @exception IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int quit() throws IOException { return sendCommand(SMTPCommand.QUIT); }
/*** * A convenience method to send the SMTP QUIT command to the server, * receive the reply, and return the reply code. * <p> * @return The reply code received from the server. * @exception SMTPConnectionClosedException * If the SMTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send SMTP reply code 421. This exception may be caught either * as an IOException or independently as itself. * @exception IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/ public int quit() throws IOException { return sendCommand(SMTPCommand.QUIT); }