EHLO

The EHLO command operates and can be used in the same way as the HELO command. However, it additionally requests that the returned reply should identify specific SMTP service extensions that are supported by the SMTP server.
Read syntax diagramSkip visual syntax diagramEHLOdomain_name
Operand
Description
domain_name
Specifies the domain name of the sending host. The domain_name may be specified as either:
  • a domain name
  • an IP address in decimal integer form that is prefixed by the number or (US) pound sign (# or X'7B')
  • an IP address in dotted-decimal form, enclosed in brackets.
  • the string IPv6: followed by an IPv6 address in full or compressed form (IPv6 mapped IPv4 addresses are acceptable).

If a server does not support SMTP service extensions, the client receives a negative reply to its EHLO command. When this occurs, the client should either supply a HELO command, if the mail being delivered can be processed without the use of SMTP service extensions, or it should end the current mail transaction.

If a client receives a positive response to an EHLO command, the server is then known to support one or more SMTP service extensions. This reply then can be further used by the client to determine whether certain kinds of mail can be effectively processed by that server.

For example, if the positive response includes the SIZE keyword, the server supports the SMTP service extension for Message Size Declaration. Whereas, if this response includes the 8BITMIME keyword, the server supports the SMTP service extension for 8-bit MIME transport.

SMTP supports the following service extensions:

EXPN HELP SIZE 8BITMIME

Following is an example of a positive reply to a client (c) EHLO command from an SMTP server (s) that supports these service extensions:
  s: (wait for connection on TCP port 25)
  c: (open connection to server)
  s: 220 HOSTA.IBM.COM running IBM VM SMTP Level 320 on Sat, 1 May 99 …
  c: EHLO HOSTB.IBM.COM
  s: 250-HOSTA.IBM.COM is my domain name.
  s: 250-EXPN
  s: 250-HELP
  s: 250-8BITMIME
  s: 250 SIZE 524288
  …
The hyphen (-), when present as the fourth character of a response, indicates the response is continued on the next line.