SMTP

SMTP 221 Closing Connection vs 530 Authentication Required

SMTP 221 (Closing Connection) is a 2xx Positive Completion response, while 530 (Authentication Required) 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, 530 means that the server requires authentication before accepting mail commands. You must issue the AUTH command with valid credentials before attempting to send mail.

描述

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 server requires authentication before accepting mail commands. You must issue the AUTH command with valid credentials before attempting to send mail.

何时出现

When trying to send mail through a server that requires authentication (typical for submission on port 587) without first logging in with the AUTH command.

如何修复

Authenticate using the AUTH command with your username and password before sending MAIL FROM. Ensure your email client is configured with the correct SMTP credentials and authentication method.

主要区别

1.

221 is a 2xx Positive Completion response, while 530 is a 5xx Permanent Negative response.

2.

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.

3.

SMTP 530: The server requires authentication before accepting mail commands. You must issue the AUTH command with valid credentials before attempting to send mail.

4.

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.

5.

You encounter 530 when when trying to send mail through a server that requires authentication (typical for submission on port 587) without first logging in with the AUTH command.

何时使用哪个

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 530 (Authentication Required): Authenticate using the AUTH command with your username and password before sending MAIL FROM. Ensure your email client is configured with the correct SMTP credentials and authentication method.

了解更多