Skip to content

EHLO vs HELO commands

HELO and EHLO are commands used to initiate the conversation between a mail client (MUA or MTA) and an SMTP server^[600-developer__smtp.md]. Both commands serve to "greet" the server and are followed by a domain name, but they differ in the protocol versions they represent and the server responses they trigger^[600-developer__smtp.md]。

HELO (Simple Mail Transfer Protocol)

The HELO command is the standard starting instruction for a client connecting to a basic SMTP server^[600-developer__smtp.md]。It indicates that the client is using the standard SMTP protocol^[600-developer__smtp.md]。

The domain name provided in the HELO command is often utilized for anti-spam verification purposes^[600-developer__smtp.md]。Therefore, best practice dictates that this domain name must be resolvable to an IP address and that the IP address matches the client's current connection IP^[600-developer__smtp.md]。

EHLO (Extended SMTP)

The EHLO command is the starting instruction for a client connecting to an eSMTP (Extended SMTP) server^[600-developer__smtp.md]。Like HELO, it requires a domain name that serves an identification role and should be resolvable to the connecting IP address^[600-developer__smtp.md]。

The primary functional difference is that when a client sends EHLO, the SMTP server responds not only with a status but also with a list of supported eSMTP extensions^[600-developer__smtp.md]。Common features advertised in this list include STARTTLS, which allows for secure, encrypted communication^[600-developer__smtp.md]。

Usage Workflow

A typical SMTP transaction involves identifying the sender and recipients after the initial greeting:

  1. Greeting: Client sends HELO or EHLO^[600-developer__smtp.md]。
  2. Sender Identification: Client sends MAIL FROM to specify the envelope sender^[600-developer__smtp.md]。
  3. Recipient Identification: Client sends RCPT TO to specify the envelope recipient^[600-developer__smtp.md]。
  4. Content Transmission: Client sends DATA to begin transferring the message content^[600-developer__smtp.md]。
  5. Termination: Client sends QUIT to end the session^[600-developer__smtp.md]。

Sources

^[600-developer__smtp.md]