502 5.5.1: command not recognized
Gmail does not know, or does not support, an SMTP command your client sent, and after too many of them it ends the session.
- Gmail
- Provider
- Permanent (5xx)
- Class
- Sources checked
- Author
At a glance
- Code
- 502 5.5.1
- Provider
- Gmail and Google Workspace
- Temporary or permanent
- PermanentRefused for good: the message comes back to the sender, and resending it gets the same answer.
- Who has to act
- The sender. The fix is on the sending side: your domain, your server or your list.
- What the server says
502 5.5.1 Unrecognized command.
What it means
Gmail answers 502 5.5.1 when a client sends a command it does not recognize or has not implemented. Google documents three wordings: 'Unimplemented command', 'Unrecognized command', and 'Too many unrecognized commands, goodbye', after which Gmail closes the connection. Typical sources are typos in hand-typed test sessions, clients that send commands Gmail did not advertise, and programs speaking another protocol, such as HTTP or IMAP, to an SMTP port. The command has to change; retrying it does not help.
Common causes
- A typo or unsupported command in a manual or scripted SMTP session.
- A client that uses an extension Gmail did not list in its EHLO reply.
- A program speaking another protocol, such as HTTP or IMAP, to an SMTP port.
How to fix it
- 01Check the session log for the exact command Gmail refused.
- 02Use only standard SMTP commands and the extensions Gmail lists in its EHLO reply.
- 03Fix the port and protocol settings of the client or device.
Sources
What this page rests on, checked on 20 Oct 2026. The explanation is ours; the reply text is the server's.
- Gmail SMTP errors and codes (Google Workspace Admin Help)knowledge.workspace.google.com
Related codes
- 503 5.5.1Command sent out of sequence.Your client sent Gmail an SMTP command at the wrong point in the conversation, such as the message before any recipient, so Gmail refused it.
- 502Command not implemented.The server recognises the command but does not implement it, so it will not carry that command out in this session.
- 5.5.1Invalid SMTP command.The sending software issued an SMTP command that the server does not support, or sent it at the wrong point in the conversation.
All 108 Gmail codesEvery code in the wikiPaste your own bounce