SMTP

SMTP 221 Closing Connection vs 535 Authentication Failed

SMTP 221 (Closing Connection) is a 2xx Positive Completion response, while 535 (Authentication Failed) 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, 535 means that the authentication credentials provided are invalid. The username, password, or authentication mechanism was rejected by the server.

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 authentication credentials provided are invalid. The username, password, or authentication mechanism was rejected by the server.

Khi bạn thấy mã này

After submitting incorrect credentials via the AUTH command. The username or password does not match any account on the server.

Cách khắc phục

Double-check your username and password. If using an app password (e.g., Gmail, Outlook), ensure it is current and has not been revoked. Also verify the correct SASL mechanism (PLAIN, LOGIN, etc.).

Sự khác biệt chính

1.

221 is a 2xx Positive Completion response, while 535 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 535: The authentication credentials provided are invalid. The username, password, or authentication mechanism was rejected by the server.

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 535 when after submitting incorrect credentials via the AUTH command. The username or password does not match any account on the server.

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 535 (Authentication Failed): Double-check your username and password. If using an app password (e.g., Gmail, Outlook), ensure it is current and has not been revoked. Also verify the correct SASL mechanism (PLAIN, LOGIN, etc.).

Tìm hiểu thêm