For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
contact@agentmail.ccDiscord
DocumentationAPI ReferenceKnowledge BaseChangelog
DocumentationAPI ReferenceKnowledge BaseChangelog
    • Introduction
  • Getting Started
    • What is AgentMail?
    • What can I do with an inbox?
    • Creating your first inbox
    • Getting your API key
  • Agent Patterns
    • Handling inbound emails
    • Allowlists & blocklists
    • Managing threaded conversations
    • Human-in-the-loop workflows
    • Pods for multi-tenant email
    • Using labels to track state
  • Domains & Deliverability
    • Custom domain setup
    • SPF, DKIM, and DMARC setup
    • Emails going to spam
    • Warming Up
    • MX record conflicts
  • Troubleshooting
    • API 403 error
    • Rate limits
    • Preventing duplicate sends
    • Domain not verifying
    • Emails bouncing
    • Why are my emails not showing up?
  • DNS Guides
    • Cloudflare
    • GoDaddy
    • Route 53 (AWS)
    • Namecheap
LogoLogo
contact@agentmail.ccDiscord
On this page
  • Use a subdomain
  • How to set it up
  • Can I use my root domain?
  • Example DNS setup
  • Common subdomain choices
Domains & Deliverability

How do I avoid MX record conflicts?

Add AgentMail DNS records without breaking existing email.
Was this page helpful?
Edit this page
Previous

What does a 403 error mean?

Common causes of API 403 Forbidden errors and how to fix them.
Next
Built with

If you already use Gmail, Outlook, or another email provider for your domain, adding AgentMail’s MX records could conflict with your existing setup. Here is how to avoid that.

Use a subdomain

The simplest and recommended approach: set up AgentMail on a subdomain instead of your root domain.

DomainUsed byNo conflict
yourcompany.comGmail / Outlook (your team)Unchanged
agents.yourcompany.comAgentMail (your agents)Separate MX records

Your agents send and receive from addresses like support@agents.yourcompany.com, while your team keeps using name@yourcompany.com. Both work independently with no overlap.

How to set it up

When adding your domain in AgentMail, use the subdomain:

TypeScript
1import { AgentMailClient } from "agentmail";
2
3const client = new AgentMailClient({ apiKey: "am_..." });
4
5// Use a subdomain to avoid MX conflicts
6const domain = await client.domains.create("agents.yourcompany.com");
7
8// Create inboxes on the subdomain
9const inbox = await client.inboxes.create({
10 username: "support",
11 domain: "agents.yourcompany.com",
12 displayName: "Support Agent",
13});
14// inbox address: support@agents.yourcompany.com

Then add the MX, SPF, and DKIM records for agents.yourcompany.com at your DNS provider. These records are completely separate from your root domain’s records and will not affect your existing email.

Can I use my root domain?

Yes, but only in these scenarios:

Sending only (no receiving): If you only need AgentMail to send emails from your root domain, you only need SPF (TXT) and DKIM (CNAME) records. These do not conflict with existing MX records, so your Gmail or Outlook inbound mail is unaffected.

Full AgentMail (sending and receiving): If you want AgentMail to also receive emails on your root domain, you would need to replace your existing MX records with AgentMail’s. This means all incoming mail for that domain routes to AgentMail instead of Gmail or Outlook. Only do this if you want AgentMail to handle all inbound email for that domain.

Example DNS setup

Before (Gmail only):

yourcompany.com MX 10 aspmx.l.google.com.
yourcompany.com MX 20 alt1.aspmx.l.google.com.

After (Gmail on root + AgentMail on subdomain):

yourcompany.com MX 10 aspmx.l.google.com.
yourcompany.com MX 20 alt1.aspmx.l.google.com.
agents.yourcompany.com MX 10 inbound.agentmail.to.
agents.yourcompany.com TXT v=spf1 include:agentmail.to ~all
agents.yourcompany.com CNAME (DKIM record from AgentMail)

Your team’s email continues to flow through Gmail. Agent emails go through AgentMail. Clean separation with no conflicts.

Common subdomain choices

SubdomainExample address
agents.yourcompany.comsupport@agents.yourcompany.com
mail.yourcompany.comoutreach@mail.yourcompany.com
ai.yourcompany.comassistant@ai.yourcompany.com

Pick whatever makes sense for your brand. The important thing is that it is a separate subdomain from your root domain’s email.