/** * * @param command the command to send (as an int defined in {@link SMPTCommand}) * @param args the command arguments, may be {@code null} * @param includeSpace if {@code true}, add a space between the command and its arguments * @return the reply code * @throws IOException */ private int __sendCommand(int command, String args, boolean includeSpace) throws IOException { return __sendCommand(SMTPCommand.getCommand(command), args, includeSpace); }
/*** * 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); }