When an SMTP send fails, an error code is returned by the server to indicate the nature of the problem. This article explains what the most common error codes mean and how to respond in each case.
What it's used for
Understanding error codes allows you to:
- Quickly identify the cause of a sending issue
- Take the right action based on the type of error
- Distinguish a temporary error from a permanent one
How it works
SMTP error codes follow a standard structure. The first digit indicates the type of response:
- 4xx: temporary error — a retry may succeed
- 5xx: permanent error — the message will not be delivered without correction
Error codes by category
| Code | Message | What it means |
|---|---|---|
| 535 5.7.8 | Authentication credentials invalid | The username or password is invalid |
| 538 5.7.0 | Must issue a STARTTLS command first | Your application is attempting to authenticate without a secure connection |
| 530 5.7.0 | Authentication required | A send command was issued before authentication |
| 535 5.7.8 | Authentication blocked due to too many failed attempts | Too many failed attempts — your IP address is temporarily blocked. Wait a few minutes before trying again and make sure you have the correct credentials |
Errors related to service limits
| Code | Message | What it means |
|---|---|---|
| 452 4.2.2 | Quota exceeded for the current period | The monthly quota of your plan has been reached |
| 452 4.5.3 | Too many recipients (max 50 per message) | The message exceeds the limit of 50 recipients |
| 454 4.7.0 | Too many active sessions for user | Your SMTP user has reached its simultaneous connection limit. Close unnecessary connections and try again |
| 454 4.7.0 | Too many active sessions for account | Your account has reached its simultaneous connection limit. Close unnecessary connections and try again |
Errors related to addresses
| Code | Message | What it means |
|---|---|---|
| 501 5.5.4 | Bad sender address syntax | The sender address is not valid |
| 501 5.5.4 | Recipient rejected: bad recipient address syntax | The recipient address is not valid |
Errors related to message content
| Code | Message | What it means |
|---|---|---|
| 523 5.3.4 | Message size exceeds fixed maximum message size | The message size exceeds 20 MB |
| 550 5.6.0 | Failed to parse MIME structure | The message structure is invalid or an attachment is corrupted. This often occurs when a file's content does not match its extension (e.g., a file renamed to .pdf that is not actually a PDF). Check your attachments |
| 554 5.6.0 | Multiple header From: addresses is not supported | The From field contains more than one address |
| 554 5.6.0 | Header From: address domain does not match authenticated user domain | The sender's domain does not match the authenticated SMTP user's domain |
Errors related to the domain
| Code | Message | What it means |
|---|---|---|
| 550 5.6.0 | The domain is not correctly authenticated | The domain used is not properly configured or validated |
Temporary system errors
| Code | Message | What it means |
|---|---|---|
| 421 4.4.2 | Temporary local problem: unable to relay message | Temporary system issue — try again later |
| 421 4.4.2 | Temporary local problem: unable to connect to upstream relay | Temporary relay connection issue — try again later |
What to do when an error code appears
Depending on the code received, here are the checks to perform:
- Authentication error: verify your SMTP username and password, and make sure TLS encryption is enabled.
- More specifically:
- Invalid credentials (535): check your username and password in the Domains tab of your account
- Unsecured connection (538): your application is attempting to authenticate without enabling STARTTLS. Enable TLS encryption in your application settings — look for the option "STARTTLS", "TLS", or "Secure connection"
- IP blocked (535 — too many attempts): wait a few minutes and make sure you have the correct credentials before trying again
- Quota reached: wait for your period to renew or change your plan in the Pricing tab.
- Too many recipients: reduce the number of recipients to a maximum of 50 per message.
- Too many simultaneous connections (454): close unnecessary SMTP connections in your application and wait a few seconds before trying again.
- Message too large: reduce the size of attachments or use download links for large files.
- Unauthenticated domain: verify that your DKIM 1, DKIM 2, and SPF/Return-Path (MX) records are validated in the Domains tab.
- Non-matching domain (554): the sender address configured in your application does not match the domain linked to your SMTP user. Verify that the domain of your From address (e.g., your-company.com) is the same as the one associated with your SMTP user in the Domains tab.
- Temporary error: retry the send — these errors generally resolve on their own.
If the problem persists, note the exact code and contact our support team.
See also: