/*** * A convenience method to send the ESMTP EHLO 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 ehlo(String hostname) throws IOException { return sendCommand(SMTPCommand.EHLO, hostname); }
InvalidKeyException, InvalidKeySpecException if (!SMTPReply.isPositiveIntermediate(sendCommand(SMTPCommand.AUTH, AUTH_METHOD.getAuthName(method)))) { return false; return SMTPReply.isPositiveCompletion(sendCommand( Base64.encodeBase64StringUnChunked(("\000" + username + "\000" + password).getBytes(getCharset())) )); System.arraycopy(hmacResult, 0, toEncode, usernameBytes.length + 1, hmacResult.length); return SMTPReply.isPositiveCompletion(sendCommand( Base64.encodeBase64StringUnChunked(toEncode))); if (!SMTPReply.isPositiveIntermediate(sendCommand( Base64.encodeBase64StringUnChunked(username.getBytes(getCharset()))))) { return false; return SMTPReply.isPositiveCompletion(sendCommand( Base64.encodeBase64StringUnChunked(password.getBytes(getCharset())))); return SMTPReply.isPositiveIntermediate(sendCommand( Base64.encodeBase64StringUnChunked(username.getBytes(getCharset())) ));