3-digit reply code Permanent

SMTP error 502

Command not implemented.

Updated Jul 1, 2026

The short answer

SMTP 502 is a permanent reply meaning "command not implemented": the server recognized the command but does not support it or has disabled it. It commonly hits VRFY, EXPN, ETRN, HELP, or an AUTH mechanism an admin turned off. Remove or replace the unsupported command in your client, or use a relay that implements it.

Quick fix

Check your client config or the server’s advertised capabilities.

5 - Permanent. The server will not try again. Fix the cause before you resend.

What it means

502 is a permanent failure defined in RFC 5321 as "Command not implemented." The leading 5 makes it permanent (retrying the same command fails again) and the middle 0 places it in the syntax and unimplemented-command group. The server parsed your command fine; it just does not offer it, either because it was never implemented or an admin disabled it. It often comes with the enhanced code 5.5.1.

Common causes

A disabled diagnostic command

VRFY (verify address) and EXPN (expand list) are commonly turned off to prevent address harvesting; RFC 5321 says a server that will not do the work should answer 502. HELP and ETRN are also frequently disabled.

An unsupported AUTH mechanism

If your client issues AUTH LOGIN or AUTH PLAIN and the relay never advertised AUTH in its EHLO response (or only supports another mechanism like XOAUTH2), you get a 502.

A minimal relay command set

Hosted relays accept the commands needed to submit mail and reject extras.

An old library using a legacy command

A script or client emitting a command the modern server no longer implements.

How to fix it

  1. Read the full response line and log

    It names the command that was refused (for example "502 5.5.1 VRFY command is disabled"). That command is the whole problem.

  2. Reproduce the dialogue manually

    Connect and issue EHLO. The 250- lines list exactly which extensions the server advertises. If your command is not there, it is not implemented.

    openssl s_client -starttls smtp -connect smtp.example.com:587
  3. Remove or replace the unsupported command

    For VRFY and EXPN, stop calling them; they are optional and routinely disabled. For AUTH, use a mechanism the server advertised: for Gmail that means an App Password (with 2-Step Verification) or OAuth2.

  4. Update an old SMTP library

    If your client emits a legacy command, upgrade it.

  5. If you control the server

    Enable the command in your MTA config (for example Postfix disable_vrfy_command = no), but leave VRFY and EXPN off if they were disabled for anti-harvesting reasons.

Common questions

Is 502 permanent or temporary?

Permanent. The leading 5 makes resending the same command fail again. You must change or remove the command rather than retry.

What is the difference between 502 and 503?

502 means the command is known but not supported. 503 means a bad sequence of commands, such as RCPT TO before MAIL FROM.

Why do I get 502 on VRFY or EXPN?

Those diagnostic commands are commonly disabled to stop address harvesting. Do not rely on them to validate recipients.

Related codes

Ready when you are

Most rejections come back to sender reputation.

Blocklists, auth failures, and policy blocks are what warmup prevents. Warm up your domain so your mail is trusted before you hit send.

7-day free trialNo credit cardCancel anytime