← Blog

How to send AI agent email from your own domain

SentFromAI

To send AI agent email from your own domain, add a subdomain you use for nothing else, such as agents.yourcompany.com, to your email provider. Publish the DKIM, SPF, MAIL FROM, DMARC and inbound MX records it returns, wait for the domain to verify, then create your agents' inboxes on it. Start DMARC at p=none and move to quarantine and then reject once test mail passes SPF and DKIM every time.

This guide walks through that setup with the SentFromAI API, explains why the hostname you pick matters more than most guides admit, and covers when the shared domain or a dedicated subdomain is the better choice. The API calls match the public OpenAPI schema and the custom domains guide as checked on November 30, 2026. The Python was tested against mocked API responses, not a live account.

Do you need your own domain?

Not always. Every SentFromAI inbox can send and receive on the shared mail.sentfrom.ai domain with no DNS work, which suits prototypes, internal agents and agents that only need an address to receive mail. A custom domain is worth it when:

  • people outside your company read the mail and should see your brand, not a provider's
  • you want the domain reputation your agents build to belong to you
  • a customer's security team checks that mail claiming to be from you is authenticated for your domain
  • you send enough volume that mailbox provider rules apply. Gmail requires SPF, DKIM and DMARC for senders of more than 5,000 messages a day to personal accounts, and Outlook.com applies the same requirement above 5,000 a day.
Option Hostname SentFromAI plan What you manage
Shared domain mail.sentfrom.ai Every plan Nothing
Custom domain your own, such as agents.yourcompany.com Pro and up DNS records at your provider
Dedicated subdomain <label>.sentfrom.ai Scale and Business Nothing, DNS is set up for you
Dedicated IP your own domain Enterprise, through sales DNS records

Plans and features are from the pricing page and the domains API reference. On the Free plan, adding a custom domain returns 402 custom_domains_require_paid_plan, and provisioning a dedicated subdomain below Scale returns 402 dedicated_subdomain_requires_scale (FAQ).

Step 1: Pick a hostname you use for nothing else

Use a fresh subdomain of your company domain, not the root domain and not a subdomain another tool already sends from. Three reasons:

  1. Inbound mail. The setup includes an MX record so replies reach your agents' inboxes. MX records decide where a hostname's mail goes, so adding one to a domain that already receives mail (your root domain on Google Workspace or Microsoft 365, for example) would send some or all of that mail to the wrong place.
  2. One SPF record per name. A hostname may publish only one SPF record. Two SPF records on the same name make the check fail with a permanent error (RFC 7208, section 3.2). A new subdomain has no record to merge with.
  3. A separate DMARC policy and reputation. Receivers look for a DMARC record at the exact From domain first and only fall back to the parent domain when none exists (RFC 9989, section 4.10.1). The subdomain's own _dmarc record therefore wins, so ramping it never changes the policy on your company mail. Separate subdomains also build their own sending reputations, which is why AWS recommends a subdomain per type of mail.

If your agents do very different jobs, such as answering support tickets and sending outbound follow-ups, consider one subdomain for each, so a bad week for one does not drag down the other. What we learned from 100,000 agent emails covers why that separation matters for agent fleets.

Step 2: Add the domain and print its records

POST /v1/domains takes a hostname and returns the domain with the DNS records to publish. Each record has a type (CNAME, TXT or MX), a fully qualified name, its content, a priority for MX records and a purpose.

import os
import requests

API = "https://api.sentfrom.ai/v1"
H = {"Authorization": f"Bearer {os.environ['SENTFROMAI_API_KEY']}"}


def add_domain(hostname: str) -> dict:
    r = requests.post(f"{API}/domains", headers=H, json={"hostname": hostname}, timeout=30)
    if r.status_code == 402:
        raise SystemExit(f"Plan upgrade needed: {r.json().get('error')}")
    r.raise_for_status()
    return r.json()


def print_records(domain: dict) -> None:
    print("domain_id:", domain["id"], "status:", domain["status"])
    for rec in domain["records"]:
        priority = f"  priority {rec['priority']}" if rec.get("priority") is not None else ""
        print(f"{rec['purpose']:<12} {rec['type']:<5} {rec['name']}\n{'':<18}{rec['content']}{priority}")


domain = add_domain("agents.yourcompany.com")
print_records(domain)

Save the domain_id. You need it to create inboxes and change the DMARC policy. If your agent works through MCP rather than REST, the SentFromAI MCP server has add_domain and get_domain tools for the same two steps.

The deliverability guide lists what comes back:

Record Type What it does
DKIM 3 CNAME Proves the message came from you and was not changed
SPF TXT Authorizes the sending servers
MAIL FROM MX and TXT Puts the bounce address on your domain, so SPF aligns with the From address
DMARC TXT at _dmarc.<hostname> Tells receivers what to do with mail that fails, and where to send reports
Inbound MX Routes replies to your agents' inboxes

Step 3: Publish the records

Copy each record exactly as returned. SentFromAI has step-by-step guides for Cloudflare, GoDaddy, Route 53 and Namecheap. Three mistakes cause most failed verifications:

  • Proxied records. On Cloudflare, set every mail record to DNS only (grey cloud). Proxying breaks authentication and routing.
  • Extra quotes. Paste TXT values without surrounding quotes. Most DNS dashboards add them for you.
  • Doubled names. The API returns fully qualified names. Some DNS dashboards expect a name relative to your zone and append the domain themselves, which creates a record at ..._domainkey.agents.yourcompany.com.yourcompany.com. If yours does, enter only the part before your root domain.

Check what the world sees before you wait on verification:

dig +short TXT _dmarc.agents.yourcompany.com
dig +short MX agents.yourcompany.com
dig +short CNAME <token>._domainkey.agents.yourcompany.com

Step 4: Confirm verification

SentFromAI checks the records automatically once they resolve, usually within minutes, so there is no need to poll. If you want an answer now, POST /v1/domains/{id}/verify re-checks, and GET /v1/domains/{id} returns the current state.

def domain_state(domain_id: str) -> dict:
    requests.post(f"{API}/domains/{domain_id}/verify", headers=H, timeout=30).raise_for_status()
    r = requests.get(f"{API}/domains/{domain_id}", headers=H, timeout=30)
    r.raise_for_status()
    d = r.json()
    return {
        "status": d["status"],                      # pending, verifying, verified or failed
        "mail_from_status": d.get("mail_from_status"),  # pending, success or failed
        "dmarc_policy": d.get("dmarc_policy"),      # none, quarantine or reject
    }

Wait for status to be verified and mail_from_status to be success. A failed MAIL FROM usually means its MX or TXT record is missing, and without it SPF will not align with your From address.

Step 5: Create inboxes on the domain

Pass the domain_id when you create an inbox. Without it, the inbox lands on the shared domain.

def create_inbox(local_part: str, display_name: str, domain_id: str) -> dict:
    r = requests.post(
        f"{API}/inboxes",
        headers=H,
        json={"local_part": local_part, "display_name": display_name, "domain_id": domain_id},
        timeout=30,
    )
    if r.status_code == 402:
        raise SystemExit(f"Plan limit: {r.json().get('error')}")
    r.raise_for_status()
    return r.json()


inbox = create_inbox("support", "Acme Support", domain["id"])
print(inbox["address"])  # support@agents.yourcompany.com

local_part is lowercased and accepts a-z, 0-9, ., _ and - (inboxes guide). Inbox limits come from your plan: 3 on Free, 100 on Pro, 1,500 on Scale and 15,000 on Business. How to give an AI agent an email address covers inbox design, such as one inbox per agent, user or task.

Then send a test message from the new inbox to a Gmail or Outlook.com account you own. In Gmail, open the message and choose More then Show original (Gmail help). You want SPF, DKIM and DMARC all to read PASS.

Step 6: Ramp DMARC from none to reject

Custom domains start with a DMARC policy you can move through three steps with POST /v1/domains/{id}/dmarc. Read the current value from dmarc_policy before you change it.

Policy What receivers do with failing mail Move on when
p=none Nothing. They only report. Test mail shows SPF, DKIM and DMARC PASS, and nothing else sends as this hostname
p=quarantine Put it in spam A sustained period with no unexpected bounces or deliverability drops
p=reject Refuse it This is the end state
def set_dmarc(domain_id: str, policy: str) -> dict:
    if policy not in ("none", "quarantine", "reject"):
        raise ValueError(policy)
    r = requests.post(f"{API}/domains/{domain_id}/dmarc", headers=H, json={"policy": policy}, timeout=30)
    r.raise_for_status()
    return r.json()  # hostname, dmarc_policy and the matching DMARC record


result = set_dmarc(domain["id"], "quarantine")
record = result["record"]
print(record["name"], record["content"])

The response includes the DMARC record for the new policy. On a domain whose DNS you host, SentFromAI cannot edit your zone, so update the _dmarc TXT value to match and confirm it with dig.

How long to wait at each step is a judgment call. The DMARC standard suggests that domains whose users post to mailing lists spend at least a month at none, then an equally long time at quarantine, before reject, because reject can break forwarded and list mail (RFC 9989, section 7.4). A subdomain that only your agents send from has one mail stream and no human users on lists, so there is far less to audit, but agent mail can still be forwarded. Keep DKIM passing above all, since DKIM signatures usually survive forwarding and SPF does not.

Two signals to watch while you ramp:

  • Bounces. Subscribe to the message.bounced webhook event (receiving guide). Bounced addresses are suppressed automatically.
  • Deliverability score. The SentFromAI dashboard shows one under Metrics.

The DMARC record SentFromAI returns sends aggregate reports to dmarc@sentfrom.ai. The docs do not say whether you can add your own reporting address, so ask support before you edit the rua tag.

Shared reputation, your own domain or a dedicated subdomain

A custom domain gives your agents a domain reputation of their own, but your mail still leaves from sending IPs other customers also use. Google notes that the activity of every sender on a shared IP affects all of them. A dedicated IP removes that dependency, but a new IP has no sending history, and mailbox providers weigh that history when they decide whether to accept mail, so it has to be warmed up with gradually rising volume (AWS).

  • Shared domain. Right for prototypes and low-stakes mail. Nothing to set up.
  • Custom domain on Pro. Right for most production agents that write to customers.
  • Dedicated subdomain on Scale or Business. POST /v1/domains/subdomain with a label provisions <label>.sentfrom.ai with DNS configured for you and isolated sending reputation (API reference). It suits fleets that want separation from other tenants without touching DNS.
  • Dedicated IP on Enterprise. For steady high volume where you want full control of IP reputation. Talk to sales for this.

FAQ

Can an AI agent send from my company's root domain?

It can, but use a subdomain instead. The inbound MX record would affect your existing company mail, your root domain may already have an SPF record you would need to merge into, and a separate subdomain keeps its own DMARC policy and reputation.

How long does custom domain verification take?

Usually minutes once the records resolve, according to the Cloudflare DNS guide. If it stays pending, check each record with dig, then call POST /v1/domains/{id}/verify to re-check.

Do I need DMARC if I send only a few emails a day?

Gmail's bulk sender rules apply above 5,000 messages a day, but Google recommends SPF, DKIM and DMARC for every domain. Without a DMARC record, receivers have no instruction from you about mail that claims to come from your agents' domain and fails authentication. SentFromAI returns a DMARC record with the other DNS records, so it is one more line in the same setup.

Does the custom domain change where my data is stored?

No. SentFromAI processes and stores email, attachments and backups in Ireland on every plan, whatever domain the inbox uses. EU-hosted email for AI agents has the details.

Can my agent set up the domain itself?

Partly. Through the API or the MCP add_domain tool, an agent can add the domain and read the records, but someone with access to your DNS still has to publish them. Treat that as a human step.

Next step

Create a free SentFromAI account and build on the shared domain, then move to Pro ($19 a month, 100 inboxes, 20,000 emails) when you are ready to add your own domain. Pricing lists every plan, and SentFromAI email covers inboxes, threads and webhooks.

Sources

Checked November 30, 2026. The code samples were tested against mocked API responses, not a live account.

Give your agents an inbox today

Start free with 3 inboxes and 5,000 emails. Scale to thousands when you're ready.