skills/setting-up-sending-domain/SKILL.md
Use when adding or verifying a Mailtrap sending domain, DNS propagation issues, registrar or DNS provider steps, compliance after verification, or click tracking. Domain must be verified before sending from it.
npx skillsauth add mailtrap/mailtrap-skills setting-up-sending-domainInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You must add and verify a domain you control before live sending. Mailtrap shows every DNS record required for that domain in the UI: add the complete set as given (do not cherry-pick). After DNS verifies, complete the compliance step if requested.
Subdomain vs root: add the exact hostname you will use in the From address. If you send from notifications.mycompany.com, add that subdomain as the sending domain—not only mycompany.com, unless you truly send from the root domain.
For step-by-step clicks at common hosts, open the matching guide on Sending domain setup (Cloudflare, Route 53, etc.) and follow it alongside the live UI values.
Related skills: authorizing-api-requests (tokens, env vars, account_id resolution), sending-emails (after domain is ready).
testing-with-sandbox)The Sending Domains API calls below need Authorization: Bearer $MAILTRAP_API_TOKEN and an $MAILTRAP_ACCOUNT_ID in the path. Token scope, storage, and the one-liner that resolves $MAILTRAP_ACCOUNT_ID from GET https://mailtrap.io/api/accounts are covered in skill authorizing-api-requests.
Prefer this path when building scripts or AI-assisted automation:
GET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/sending_domains — lists domainsGET https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/sending_domains/{sending_domain_id} — returns dns_records (each with type, name, value, and verification status) and dns_verified. Poll after you publish DNS.POST https://mailtrap.io/api/accounts/$MAILTRAP_ACCOUNT_ID/sending_domains with domain_name when your flow provisions domains programmatically.Human fallback: Sending Domains > Add domain > copy values into the registrar UI > Verify when API automation is not available.
dig, nslookup, or an online DNS lookup to confirm each record is visible publicly before clicking Verify again.Product walkthrough: Sending domain setup.
Mailtrap publishes click-path guides for common providers. Open the page that matches the user's DNS host and follow it together with the live UI records:
If the user's provider is not listed, the same rule applies: copy every record from Mailtrap into the DNS zone that serves the From domain.
If your DNS provider proxies records (orange-cloud on Cloudflare, similar CDN/proxy modes elsewhere), verification-related records must be DNS-only (grey cloud / non-proxied) unless Mailtrap documentation explicitly allows proxying—proxied CNAMEs and similar often break SPF/DKIM verification. The same constraint applies to any host that fronts DNS with a proxy.
development
Use when creating or sending Mailtrap-hosted email templates, Handlebars personalization, template UUID in API payloads, or debugging variables and preview. Use when separating email design from application code for transactional or bulk sends.
development
Use when capturing outbound email in development or staging without delivering to real recipients, inspecting HTML or headers, running spam or structure checks, or automating tests against a fake inbox. Use when testing outgoing mail from an app without committing to a production ESP yet. Use when using Mailtrap Email Sandbox, Sandbox API, or sandbox-mode sending.
development
Use when integrating, configuring, or troubleshooting Mailtrap live email sending (Email API or SMTP). Use when wiring outbound mail from an application or choosing how to send.
development
Use when converting or migrating email templates from another provider (SendGrid, Mailgun, Mandrill, Postmark, Brevo, Amazon SES) to Mailtrap-compatible Handlebars syntax. Supports single file, bulk directory, and inline HTML conversion.