What are SMTP Error Codes?

IPWITHEASE | Blog,Protocol

Sometimes, you spend a lot of time writing an email, only to find out that it did not get to the intended recipient. In such a case, you’ll receive an error message notifying you of the failure. An SMTP error code in this message will help you pinpoint the cause of the problem. This article will introduce you to SMTP error codes and help you understand what they mean.

What are SMTP Error Codes

What is an SMTP Error Code?

We’ll start by reviewing what SMTP is. This abbreviation stands for Simple Mail Transfer Protocol, the standard protocol for relaying emails. Whenever you type an email and hit send, the message doesn’t just pass through thin air. It is delivered through two or more mail servers, and SMTP is the set of rules guiding this transfer.

When two computers engage in an SMTP session, the one initiating the connection, aka client, sends a sequence of commands to the receiving computer, which in this scenario is called the server. The server, in turn, responds to each of the client’s commands. The response consists of a three-digit code, known as SMTP response code, and a human-readable line. This way, the response can be not only processed by the client, but also read by an actual person, which may be useful for troubleshooting.


Here’s what an SMTP session may look like:

Server: 220 smtp.example.com ESMTP Postfix

Client: HELO relay.example.com

S: 250 smtp.example.com, I am glad to meet you

C: MAIL FROM:<bob@example.com>

S: 250 Ok

C: RCPT TO:<alice@example.com>

S: 250 Ok


S: 354 End data with <CR><LF>.<CR><LF>

C: From: “Bob Example” <bob@example.com>

C: To: Alice Example <alice@example.com>

C: Date: Tue, 15 Jan 2008 16:02:43 -0500

C: Subject: Test message


C: Hello Alice.

C: This is a test message.

C: Yours, Bob.

C: .

S: 250 Ok: queued as 12345


S: 221 Bye

The server closes the connection

If email delivery fails, the server’s response (both the SMTP response code and the accompanying line) will be returned to the sender, making it possible to notice the failure and take appropriate actions.

The Classes of SMTP Responses

Not all SMTP codes indicate an error. Below, we’ll examine the possible response codes an email server can give after receiving an SMTP command. Each code consists of three digits, and the first digit has the following meaning:

2 – The server understands the command and has executed it successfully.

3 – The server has accepted the command but needs more information.

4 – A temporary error prevents the server from acting on the command; the client may retry the action later.

5 – The server has encountered a permanent failure, i.e. further attempts will not succeed.

Positive Completion Codes

We mentioned above that not all codes indicate failure. Examples of positive action codes, starting with a 2 or 3, are shown below.


  • 220 – The server is ready for request.
  • 221 – The server is terminating the connection after finishing the task.
  • 250 – The requested action was completed successfully. 


Responses beginning with 3 are positive, but the server needs more information to execute the command. 

  • 334 – The server is waiting for authentication credentials.
  • 354 – The server has received the “From” and “To” addresses of the email and is waiting for the message body.

Negative Completion Codes

Negative completion codes, or SMTP errors, start with a 4 or 5. Codes starting with 4 indicate temporary failure that can be resolved by retrying the action later, and codes starting with 5 indicate permanent failures needing immediate attention. Below are a few examples of such codes and their meanings:


  • 421 – The server is unavailable, and the connection is being terminated.
  • 450 – The recipient’s mailbox is not available.
  • 451 – Action aborted due to local error.
  • 452 – Insufficient system storage.


  • 500 – Command unrecognized because of a syntax error.
  • 501 – The server encountered a syntax error in parameters (for example, a typo in the receiving address).
  • 502 – The command is not implemented.
  • 503 – Bad sequence of commands.
  • 550 – The recipient’s mailbox is not available.
  • 551 – Recipient is not local.
  • 552 – Insufficient storage space in the recipient’s mailbox.
  • 554 – The receiving server rejected the message with no further explanation.

Causes of SMTP Errors

The most common causes of SMTP errors include:

  • Spelling errors in the recipient’s address.
  • Attachments that are too large for the recipient’s mailbox.
  • The sender’s domain was blacklisted for spam.
  • The incoming message was identified as spam.
  • The receiver has exceeded email storage limits on their account.


We have explained the very basic things about SMTP errors. At this point, you should understand them enough to take the necessary actions if you ever encounter one.

Continue Reading:

Difference between TCP and UDP

IP Well Known Port Numbers/ Common TCP


Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart