What does 502 mean?

Still have a question, spotted an error, or have a better explanation or a source we should cite?

You sent a command to an SMTP server, and it came back with a 502. That's the server's way of saying it understood what you asked, but it simply doesn't support that command. Not a temporary hiccup like a 421. Not a permissions issue. The feature just isn't there.

In technical terms, 502 means "command not implemented." The server received a recognized SMTP command but has no way to execute it, either because the feature was never built in, or because it's been disabled on that specific mail server.

A few real-world examples of when you'd see this: trying to use STARTTLS on a server that hasn't enabled TLS support, sending an extended SMTP command to a server running a stripped-down config, or hitting a receiving server that blocks certain extensions for security reasons.

Common 502 messages you might actually see in logs:

  • "502 Command not implemented"
  • "502 Feature not supported"
  • "502 Unimplemented command"

The fix is usually straightforward. First, run an EHLO handshake against the server and check what it actually advertises as supported. Whatever isn't in that list, don't try to use. If you're connecting through an ESP or relay and getting this, check whether TLS or another extension needs to be toggled on in your account settings. If you're managing your own mail server, look at your SMTP daemon config to confirm which extensions are active.

A 502 is a permanent 5xx error, so the sending server won't retry. You need to change your approach before trying again.

If you're seeing this mid-integration and can't tell which command is triggering it, our free Email Header Analyzer can help you trace exactly what happened during the exchange. Or if you're stuck, the SOS hotline is free and we'll walk through it with you.

Contributors

Who worked on this answer

Every name links to their profile. Every company links to their site. Real people, real accountability.

Ask an AI · tailored to your setup

Diagnose my 502 error

I'm getting a 502 SMTP error when connecting to your mail server or ESP. Tell me: (1) which SMTP command is most likely causing a 502 in my setup, (2) how to run an EHLO check to see what the server actually supports, and (3) what config change would fix this specific error.

Edit the yellow boxes, then send to the AI of your choice.