503 5.5.1: command 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.
- Gmail
- Provider
- Permanent (5xx)
- Class
- Sources checked
- Author
At a glance
- Code
- 503 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
503 5.5.1 Bad sequence of commands.
What it means
SMTP commands come in a fixed order: EHLO, then MAIL FROM, then one or more RCPT TO, then DATA. Gmail received one out of turn and refused it. Google documents several wordings: a plain 'Bad sequence of commands', a longer note that a transaction command was issued out of sequence, and 'RCPT first', which means DATA arrived before any recipient was accepted. That last one often follows a session in which every RCPT TO was rejected and the client sent the message anyway. The fault lies in the sending software, and it repeats until that is fixed.
Common causes
- A client that sends DATA after all its recipients were rejected.
- Pipelining or custom code that sends commands before earlier replies arrive, and ignores failures.
- A client that sends MAIL FROM a second time without finishing or resetting the transaction.
How to fix it
- 01Check the SMTP log of the failed session to see which command came out of order.
- 02If recipients were rejected, deal with those rejections first, since a message cannot go without a valid recipient.
- 03Fix or update the client so it waits for each reply and stops when a command fails.
- 04Use RSET to start a new transaction instead of sending MAIL FROM again.
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.1EHLO or HELO missing.Your client started sending mail commands to Gmail without first greeting it with EHLO or HELO, which SMTP requires.
- 503 5.5.1DATA sent after BDAT.Your client began sending the message in BDAT chunks and then switched to DATA in the same transaction, which the CHUNKING extension does not allow.
- 503Bad sequence of commands.The client sent a command at the wrong point in the conversation, for example message data before any recipient was accepted, or mail before logging in.
- 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