Emails sent via the Nylas /send endpoint are flagged as spam / bounced, yet emails sent via the providers' mail client are received successfully.
Follow the steps below to determine the cause and the next steps. The bounce message (554 5.7.1 / 5.1.8) will typically tell you if it's a block due to:
- Modifying headers - SPAM
- IP BLOCK
- Email Account flagged as SPAM
- Message rejected due to local policy (could be anything including - Domain reputation)
You may get these response from the recipient OR the sending SMTP server.
1. Confirm that this behaviour happens ONLY when sending via Nylas
- Have the customer send the same email to the recipient via the providers webmail client
- If the email is blocked when sent via the provider then the issue is with either:
- The providers SMTP IP address
- The senders domain reputation
- If this is an IMAP / generic account this is the problem 90% of the time.
- Solution: to either of the above is to have the customer contact their mail administrator.
2. Is you application modifying the headers, i.e. are you sending as RAW vs MIME? Providers do not trust modified headers.
- Is you application calling the /send endpoint using RAW MIME?
curl -X POST 'https://api.nylas.com/send' \ -H 'Content-Type: message/rfc822' \<<<< RAW MIME
- Try sending it via NYLAS as MIME.
curl --request POST \ --url https://api.nylas.com/send \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \
- Solution: Don't modify your headers, modify the body instead. The Nylas default is to send as MIME.
3. Microsoft and Google have a separate SMTP server for applications
An email sent via the Providers mail client will be sent via a different SMTP server than that used by third-party applications such as Nylas.
They have a pool of outbound SMTP servers which applications such as Nylas get directed to via DNS round robin.
The client's domain shares these servers with other organisations, as such the reputation on these servers IP addresses can be tarnished by third parties using those same servers.
- Open the sent email in a text editor and check the header it should have a list of hostnames / IP addresses used in the path to send the email.
- Lookup those IP's with https://mxtoolbox.com/blacklists.aspx to see if they are blacklisted
- Solution: Reach out to the domains mail administrator, they will need to ask their Provider to change their outbound SMTP server. This is quite a common issue.
- Contact Google Workspace Support
- Contact MS Support
4. The account is sending spam
- The outbound email server, i.e. the users own mail server, is blocking email before it is sent
- MS: User received a 5.1.8 response. I am an email admin, How do I fix this?
5. Try sending the email without link tracking enabled.
5 . Checked all the above and it all comes back clean
- Get the RAW message to find the FULL headers which have the spam report and pass the headers into ChatGPT to determine why the bounced message identified as SPAM
- Test the IP's and domains in the headers against blacklist checkers
- Find the Header Message-ID as per our docs
- If this is happening for ALL messages for a specific provider then reach out to support.