/*** * Fetches a reply from the SMTP server and returns the integer reply * code. After calling this method, the actual reply text can be accessed * from either calling {@link #getReplyString getReplyString } or * {@link #getReplyStrings getReplyStrings }. Only use this * method if you are implementing your own SMTP client or if you need to * fetch a secondary response from the SMTP server. * <p> * @return The integer value of the reply code of the fetched SMTP reply. * @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 receiving the * server reply. ***/ public int getReply() throws IOException { __getReply(); return _replyCode; }
/*** Initiates control connections and gets initial reply. ***/ @Override protected void _connectAction_() throws IOException { super._connectAction_(); _reader = new CRLFLineReader(new InputStreamReader(_input_, encoding)); _writer = new BufferedWriter(new OutputStreamWriter(_output_, encoding)); __getReply(); }
/** * Send a command to the server. May also be used to send text data. * * @param command the command to send (as a plain String) * @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(String command, String args, boolean includeSpace) throws IOException { StringBuilder __commandBuffer = new StringBuilder(); __commandBuffer.append(command); if (args != null) { if (includeSpace) { __commandBuffer.append(' '); } __commandBuffer.append(args); } __commandBuffer.append(SocketClient.NETASCII_EOL); String message; _writer.write(message = __commandBuffer.toString()); _writer.flush(); fireCommandSent(command, message); __getReply(); return _replyCode; }
/*** * Fetches a reply from the SMTP server and returns the integer reply * code. After calling this method, the actual reply text can be accessed * from either calling {@link #getReplyString getReplyString } or * {@link #getReplyStrings getReplyStrings }. Only use this * method if you are implementing your own SMTP client or if you need to * fetch a secondary response from the SMTP server. * <p> * @return The integer value of the reply code of the fetched SMTP reply. * @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 receiving the * server reply. ***/ public int getReply() throws IOException { __getReply(); return _replyCode; }
/*** * Fetches a reply from the SMTP server and returns the integer reply * code. After calling this method, the actual reply text can be accessed * from either calling {@link #getReplyString getReplyString } or * {@link #getReplyStrings getReplyStrings }. Only use this * method if you are implementing your own SMTP client or if you need to * fetch a secondary response from the SMTP server. * <p> * @return The integer value of the reply code of the fetched SMTP reply. * @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 receiving the * server reply. ***/ public int getReply() throws IOException { __getReply(); return _replyCode; }
/*** Initiates control connections and gets initial reply. ***/ protected void _connectAction_() throws IOException { super._connectAction_(); _reader = new BufferedReader(new InputStreamReader(_input_, __DEFAULT_ENCODING)); _writer = new BufferedWriter(new OutputStreamWriter(_output_, __DEFAULT_ENCODING)); __getReply(); }
/*** Initiates control connections and gets initial reply. ***/ @Override protected void _connectAction_() throws IOException { super._connectAction_(); _reader = new BufferedReader(new InputStreamReader(_input_, encoding)); _writer = new BufferedWriter(new OutputStreamWriter(_output_, encoding)); __getReply(); }
private int __sendCommand(String command, String args, boolean includeSpace) throws IOException { String message; __commandBuffer.setLength(0); __commandBuffer.append(command); if (args != null) { if (includeSpace) __commandBuffer.append(' '); __commandBuffer.append(args); } __commandBuffer.append(SocketClient.NETASCII_EOL); _writer.write(message = __commandBuffer.toString()); _writer.flush(); if (_commandSupport_.getListenerCount() > 0) _commandSupport_.fireCommandSent(command, message); __getReply(); return _replyCode; }
private int __sendCommand(String command, String args, boolean includeSpace) throws IOException { String message; __commandBuffer.setLength(0); __commandBuffer.append(command); if (args != null) { if (includeSpace) __commandBuffer.append(' '); __commandBuffer.append(args); } __commandBuffer.append(SocketClient.NETASCII_EOL); _writer.write(message = __commandBuffer.toString()); _writer.flush(); if (_commandSupport_.getListenerCount() > 0) _commandSupport_.fireCommandSent(command, message); __getReply(); return _replyCode; }