SMTP 221 Closing Connection vs 251 User Not Local
Both SMTP 221 (Closing Connection) and 251 (User Not Local) belong to the 2xx Positive Completion category. 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. Meanwhile, 251 means that the recipient is not local to the server, but it will forward the message to the specified forwarding address. The server acts as a relay for this recipient.
説明
The server is closing the transmission channel. This is the normal response to the QUIT command, indicating a graceful end to the SMTP session.
このコードが表示される場合
After sending the QUIT command at the end of a mail session. The server acknowledges the disconnect and the TCP connection will be closed.
解決方法
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.
説明
The recipient is not local to the server, but it will forward the message to the specified forwarding address. The server acts as a relay for this recipient.
このコードが表示される場合
When sending to a recipient whose mailbox is hosted on a different server. The current server knows the forwarding address and will relay the message on your behalf.
解決方法
No fix needed — the message will be forwarded automatically. To avoid relaying, send directly to the address provided in the server's 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 251: The recipient is not local to the server, but it will forward the message to the specified forwarding address. The server acts as a relay for this recipient.
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 251 when when sending to a recipient whose mailbox is hosted on a different server. The current server knows the forwarding address and will relay the message on your behalf.
どちらをいつ使うか
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 251 (User Not Local): No fix needed — the message will be forwarded automatically. To avoid relaying, send directly to the address provided in the server's response.