SMTP 221 Closing Connection vs 421 Service Not Available
SMTP 221 (Closing Connection) is a 2xx Positive Completion response, while 421 (Service Not Available) is a 4xx Transient 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, 421 means that the SMTP service is not available and the server is closing the transmission channel. This may be sent as a greeting or during a session if the server needs to shut down.
Description
The server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session.
When You See It
After sending the QUIT command at the end of a mail session. The server acknowledges the disconnect and the TCP connection will be closed.
How to Fix
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.
Description
The SMTP service is not available and the server is closing the transmission channel. This may be sent as a greeting or during a session if the server needs to shut down.
When You See It
When connecting to a mail server that is overloaded, undergoing maintenance, or shutting down. The server cannot handle your request right now.
How to Fix
Retry the connection after a delay. If the issue persists, check server status and resources (CPU, memory, disk). Rate limiting or greylisting may also trigger this response.
Key Differences
221 is a 2xx Positive Completion response, while 421 is a 4xx Transient 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 421: The SMTP service is not available and the server is closing the transmission channel. This may be sent as a greeting or during a session if the server needs to shut down.
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 421 when when connecting to a mail server that is overloaded, undergoing maintenance, or shutting down. The server cannot handle your request right now.
When to Use Which
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 421 (Service Not Available): Retry the connection after a delay. If the issue persists, check server status and resources (CPU, memory, disk). Rate limiting or greylisting may also trigger this response.