SMTP 221 Closing Connection vs 503 Bad Sequence
SMTP 221 (Closing Connection) is a 2xx Positive Completion response, while 503 (Bad Sequence) is a 5xx Permanent Negative response. 221 indicates that the server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session. In contrast, 503 means that the commands were sent in the wrong order. SMTP requires a specific command sequence (EHLO, MAIL FROM, RCPT TO, DATA) and this error indicates a step was skipped or repeated.
Mô tả
The server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session.
Khi bạn thấy mã này
After sending the QUIT command at the end of a mail session. The server acknowledges the disconnect and the TCP connection will be closed.
Cách khắc phục
No fix needed — this is the expected response when ending an SMTP session. If you see this unexpectedly, the server may be shutting down or timing out idle connections.
Mô tả
The commands were sent in the wrong order. SMTP requires a specific command sequence (EHLO, MAIL FROM, RCPT TO, DATA) and this error indicates a step was skipped or repeated.
Khi bạn thấy mã này
When sending DATA before RCPT TO, or MAIL FROM before EHLO. The server enforces the correct SMTP command sequence and you have sent a command out of order.
Cách khắc phục
Follow the proper SMTP command sequence: EHLO/HELO first, then MAIL FROM, then RCPT TO (one or more), then DATA. Reset with RSET if you need to start over.
Sự khác biệt chính
221 is a 2xx Positive Completion response, while 503 is a 5xx Permanent Negative response.
SMTP 221: The server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session.
SMTP 503: The commands were sent in the wrong order. SMTP requires a specific command sequence (EHLO, MAIL FROM, RCPT TO, DATA) and this error indicates a step was skipped or repeated.
You encounter 221 when after sending the QUIT command at the end of a mail session. The server acknowledges the disconnect and the TCP connection will be closed.
You encounter 503 when when sending DATA before RCPT TO, or MAIL FROM before EHLO. The server enforces the correct SMTP command sequence and you have sent a command out of order.
Khi nào dùng cái nào
For 221 (Closing Connection): No fix needed — this is the expected response when ending an SMTP session. If you see this unexpectedly, the server may be shutting down or timing out idle connections. For 503 (Bad Sequence): Follow the proper SMTP command sequence: EHLO/HELO first, then MAIL FROM, then RCPT TO (one or more), then DATA. Reset with RSET if you need to start over.