This post is part of our “What to do when there’s no email admin” series — practical guides for anyone who suddenly finds themselves responsible for email systems they’ve never touched before.
If emails sent through your app land in spam or bounce with errors like 554 5.7.1 or 5.1.8, it’s easy to assume something is wrong with your API call or integration.
Usually, nothing is wrong with your code.
In almost every case, the provider is blocking or filtering the message based on reputation signals, header manipulation, or the SMTP infrastructure third-party apps are forced to use.
This guide walks through the exact steps to diagnose the issue and figure out what’s actually happening behind the scenes.
1. Confirm it only happens when sending through your app
Ask the user to send the exact same message from their webmail client (Outlook, Gmail, etc.).
If it fails both ways: The problem is almost certainly:
Poor IP reputation on the provider’s SMTP server
Low sender domain reputation
DNS issues (SPF/DKIM/DMARC mismatch)
With IMAP or generic accounts, this is the culprit 90% of the time.
Fix: The user’s mail admin or provider must resolve the domain or SMTP IP reputation issue.
If it only fails when sent via your app: Then something in the programmatic send path is triggering filtering. Move on to the next checks.
2. Check if your application is modifying headers
If you use raw message/rfc822, you may unintentionally rewrite system headers — a major spam trigger.
Risky (raw MIME)
curl -X POST 'https://api.nylas.com/send' \ -H 'Content-Type: message/rfc822'
Recommended (JSON MIME)
curl -X POST 'https://api.nylas.com/send' \ -H 'Content-Type: application/json'
Fix: Don’t modify headers. Modify the body instead. When possible, send JSON MIME — Nylas defaults to this format.
3. Understand Microsoft and Google’s dual-SMTP model
Emails sent from Outlook or Gmail’s UI use different SMTP servers than emails sent by third-party apps.
Third-party apps are routed to shared SMTP pools. If anyone in that pool sends spam, the IP reputation drops — and your messages get filtered.