SMTP codes and error messages

This topic gives an introduction to the SMTP protocol and describes status codes and possible reasons for SMTP errors.

SMTP protocol

SMTP stands for Simple Mail Transfer Protocol, which provides mechanisms for the transmission of emails and is the technical standard behind the sending, relaying and receiving of these.

When you start a mailing in Optimizely Campaign, it is transferred to the Optimizely Campaign sending SMTP server, a so-called Mail Transfer Agent (MTA). The MTA relays your e-mails to the receiving server of the target ISPStands for "internet service provider" or domain owner via the SMTP protocol, which ultimately delivers the individual e-mails to the corresponding mailboxes.

Image: SMTP protocol

In an ideal world, your email gets accepted by the ISP and delivered to the intended recipient's inbox. Having some experience with email marketing, you already know that this is not always what happens. Your emails may get delayed, land in the spam folder, or may be dropped or returned to you as a bounceGenerated whenever an email fails to reach a recipient's server or mailbox..

SMTP status codes

Since there are many potential outcomes of a sending attempt, standard mechanisms for the reporting of mail system errors were developed to make processing and analysis of these easier and more transparent. The result of this is a list of possible SMTP status codes that you will often see included in bounce messages when analyzing your returns.

In most cases, the mailbox providers return two pieces of information in the event of a bounce, a traditional SMTP response status code and an enhanced mail system status code. Both provide information about the reason for the rejection and help in finding a solution.

Traditional SMTP respone status codes

According to the first scheme developed, the traditional SMTP response status codes defined in RFC 5321, the receiving SMTP server of an ISP or domain owner responds to the sender using a three-digit code. All SMTP response status codes are separated into five classes and the first digit of the status code defines the class of response:

  • 1xx (Informational). The request was received, continuing process.
  • 2xx (Success). The request was successfully received, understood, and accepted.
  • 3xx (Redirection). Further action needs to be taken, in order to complete the request.
  • 4xx (Persistent transient failure). The request contains bad syntax or cannot be fulfilled.
  • 5xx (Permanent errors). The server failed to fulfill an apparently valid request.

A successfully delivered e-mail has the status code 250 Requested mail action okay completed.

The SMTP response status codes to be applied are defined by the host of a server. Different ISPs, mailbox providers or domain owners may define them differently. Therefore, there is no unique presentation.

Enhanced mail system status codes

Since the information provided in the traditional codes is limited and there was a need for reporting mechanisms richer than these, a new set of enhanced mail system status codes was proposed in RFC 3463. The enhanced mail system status codes are based on the SMTP theory of reply codes and adopt the success, permanent error, and transient error semantics of the first value, with a further description and classification in the second:

  • 2.XXX.XXX (Success). Success specifies that the DSN is reporting a positive delivery action. Detail sub-codes may provide notification of transformations required for delivery.
  • 4.XXX.XXX (Persistent Transient Failure). A persistent transient failure is one in which the message as sent is valid, but persistence of some temporary condition has caused abandonment or delay of attempts to send the message. If this code accompanies a delivery failure report, sending in the future may be successful.
  • 5.XXX.XXX (Permanent Failure). A permanent failure is one which is not likely to be resolved by resending the message in the current form. Some change to the message or the destination must be made for successful delivery.

A successfully delivered e-mail has the status code 2.0.0 (success).

Just like the traditional SMTP response status codes, the application of these varies from mailbox provider to mailbox provider. For undelivered emails, are may transmitted bounce codes as below. These can appear as a persistent transient failure starting with a 4, or as a permanent failure starting with a 5.

Reasons for SMTP errors

Just as there are a multitude of SMTP codes, they also come from a multitude of possible causes. These are the most commonly observed:

SMTP errors and bounce issues can be greatly reduced by following the Deliverability best practices.

Optimizely's bounce management recognizes all common SMTP error codes and messages received by the ISPs or mailbox providers and classifies them in the appropriate bounce category. They are regularly reviewed and updated to provide you bounce processing according to the latest industry standards.