Example usage for org.apache.commons.net.smtp SMTPCommand EHLO

List of usage examples for org.apache.commons.net.smtp SMTPCommand EHLO

Introduction

In this page you can find the example usage for org.apache.commons.net.smtp SMTPCommand EHLO.

Prototype

int EHLO

To view the source code for org.apache.commons.net.smtp SMTPCommand EHLO.

Click Source Link

Document

The extended hello command

Usage

From source file:de.burlov.ultracipher.core.mail.AuthenticatingSMTPClient.java

/**
 * A convenience method to send the ESMTP EHLO command to the server,
 * receive the reply, and return the reply code.
 * <p/>/*from w  ww.ja v  a2 s  . c o  m*/
 *
 * @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 java.io.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);
}