MailSlurp logo

Set up custom email domains with MailSlurp

Documentation navigation
Search documentation

Create branded email addresses with MailSlurp custom domains, verify DNS, manage sender authentication, and route messages through inboxes and APIs.

View MarkdownAgent setup

Custom domains let you create email addresses on a domain you control, such as my-address@my-site.com. They are useful when a test or application needs the same branded sender identity that customers will see. A verified custom domain also gives you direct control over DNS authentication and sender configuration, which are important foundations for healthy email delivery.

Managing domains

To manage custom domains you can use the MailSlurp dashboard domain page.

Creating domains

To create a custom domain make sure your plan supports domains then navigate to the domains section via the inboxes sidebar link.

create custom domain

Ensure you have registered your domain name with a domain registrar first then enter the details into the form. You will need to add a DNS record to your domain to verify ownership. This is covered in the next step.

Verifying domains

To use your domain with MailSlurp you must verify ownership. This is done by adding a DNS record to your domain. The DNS records must all be added exactly as shown on the domain page.

create custom domain

Adding DNS records

On the domain overview page you will see a table with DNS records. You must add these DNS records to your domain registrar DNS settings.

Note. This is an example. Use the unique records provided by the dashboard

create custom domain

It can take up to 72 hours for DNS changes to be recognized. Reload the domain overview page to check your domain verification status.

Creating custom email addresses

To use your domain with inboxes navigate to the inbox creation page and select the custom domain option. You can then select the domain you want to use from the dropdown and add a local address part as a prefix.

create custom domain

Catch all inboxes

When you create a custom domain, MailSlurp also creates a wildcard catch-all inbox. Catch-all email addresses receive messages that are not addressed to a specific inbox on your domain. You can access the catch-all inbox through the domain object in the API or dashboard, then use it like a regular inbox with forwarding, auto-replies, rulesets, and webhooks.

const domains = await mailslurp.domainController.getDomains();
const desiredDomain = domains.find(
  (d) => d.domainType === DomainPreviewDomainTypeEnum.SMTP_DOMAIN
);
const catchAllInboxId = desiredDomain!.catchAllInboxId;

Using domains with the API

You can use custom domains with the MailSlurp API. Once your domain is verified you can create inboxes using the domain in an address like so:

await mailslurp.inboxController.createInbox({
  emailAddress: 'test@mydomain.com'
})