Skip to content

Sending errors

Sometimes, delivery of email messages might fail if the end user’s email gateway rejects the message. This can happen for a number of reasons, including illegal attachment data, bad credentials, or rate-limiting.

If the email message is submitted successfully, the server responds with a 200 OK HTTP response. If the message is not submitted, the server responds with an error code.

Nylas error codes

The following table describes the error codes you might encounter when sending email messages with Nylas.

Status codeTypeDescription
400Bad requestYour request was not formed properly, or contains an invalid parameter. The most common cause is invalid JSON.
402Message rejectedThe provider rejected the email message because of its content or recipients. If the error includes “Sending to at least one recipient failed”, it means that your email message might have been delivered to only a subset of recipients.
403UnauthorizedThe server was not able to authenticate with the provider. Re-authenticate the end user and try again.
422Mail provider errorAn error occurred while the provider was sending the email message. See the server_error parameter in the response JSON for more information.
429Quota exceededThe end user has exceeded their provider’s sending quota. There is no reliable way to determine these limits. Wait and try again later.
429Account throttledThe account is in a throttled state and the mail server has asked Nylas to temporarily stop making requests. Wait and try again later.
429Nylas API rate limitYou made too many requests to the Nylas API too quickly. Wait and try again later. For more information, see the Rate limiting documentation.
503Service unavailableNylas encountered an error while connected to the provider. Wait and try again later.

For more information about errors and status codes, see Nylas API responses, errors, and HTTP status codes.

Nylas error responses

When you receive an error from Nylas, it includes a JSON payload with information about the specific error.

ParameterTypeDescription
typestringThe type of error encountered.
messagestringA brief, human-readable description of the error.
server_errorstring(Optional) The original error returned by the end user’s email server.

Microsoft sending errors

Sometimes, you might receive a 120 error from Microsoft when attempting to send an email message, similar to the following example:

120 MailSubmissionFailed The server failed to submit the message for delivery.

This is usually because you’re trying to send an email message using an email address other than the one you authenticated to Nylas (for example, if you authenticated using [email protected], but you try to send an email message from [email protected]). When this happens, Nylas returns a 422 error with the following message: “Message delivery submission failed.” It might also return a 429 error.

Follow these steps to troubleshoot the error:

  1. Check the email account you’re trying to send the email message with, and verify that it’s the same as the account you authenticated to Nylas.
  2. Try to send the email message again with exponential backoff.
  3. Confirm that the Exchange server hasn’t quarantined Nylas’ dummy devices. See Checking for quarantined EAS devices.
  4. Confirm that your Microsoft 365 settings match Nylas’ recommended settings.

If these troubleshooting steps don’t fix the error, you might be encountering a more complex issue that occurs on a small number of hosted Exchange and Microsoft 365 servers. For further troubleshooting, contact your email administrator or provider.