Creating real email addresses on demand is a key feature of MailSlurp. Before you start sending and receiving emails you need an inbox.

What is an inbox?

An inbox is a private email account belonging to your API Key. Inboxes have real, unique email addresses that can send and receive emails and attachments. You can create inboxes in code or using the dashboard.

create-inbox

Inbox features:

Inbox types

Inboxes can be either or mailboxes. inboxes are the default and best for most cases. They can send and receive emails and are processed by AWS SES. inboxes are processed by a custom mail server running at . Use inboxes if you need SMTP and IMAP access or are supported older mail clients. For more information see the SMTP vs HTTP inbox guide.

Email addresses

Inboxes have an email address that is either randomly assigned by MailSlurp or specified by you when created. You can only use custom email addresses with a custom domain.

Creating an inbox

You can create inboxes using the dashboard or with the API. Inboxes are either given a randomly assigned email address at creation or use the email address you provide. Note you must verify your domain to use a custom address.

Here is how to create an inbox using the Javascript SDK.

Pretty simple! Inboxes use type configuration by default meaning they are processed by AWS SES. inboxes are suitable for test email accounts and other use cases that require IMAP and SMTP access. To support all email clients use an type inbox. inboxes are slower but support all email clients and are more suited to client facing application that are receiving emails only.

SMTP/IMAP access

Inboxes created with type have access enabled via SMTP and IMAP but require a password and username. Configure this in your dashboard or see the access guide.

Virtual inboxes

Every inbox can be created with the setting to enable a fake SMTP server. Virtual inboxes allow inbound emails but prevent any emails from being sent to real users. You can use them to test emails safely without spamming users.

Virtual inboxes still create records so you can check the result but no email will leave the fake SMTP server.

fake smtp server

Create inbox options

You can also create inboxes in other ways using the directly. An example in Javascript is as follows:

Custom email addresses

By default inboxes are assigned a randomly-generated email address ending in .

For instance: . Use the MailSlurp domain pool options with inbox requests to generate email addresses with end domains selected randomly for a list of MailSlurp domains such as , etc.

You can specify custom email addresses by using a custom domain. For instance: .

Or using the inbox controller directly:

To select your own email address you must use a custom domain. Custom domains can be purchased from any domain provider and then added to the MailSlurp dashboard.

If no email address is selected MailSlurp will by default use a randomly assigned email address ending in .

Short email addresses

Create email accounts with addresses less than 31 characters using the option:

Domain pool

Use the useDomainPool option when creating inboxes to generate email addresses with an email address ending in , etc. This is useful when receiving emails on corporate mail servers that may filter out the default MailSlurp domain.

Aliases, forwarding and plus suffix

MailSlurp does not support suffix email addresses such as . This is because this is not a part of the SMTP standard and is instead a feature that Gmail and other providers added themselves. In MailSlurp every address is treated as distinct. Use the email aliases feature to create aliases for an inbox or address to allow auto-forwarding. These are forwarded to your underlying email just like addresses.

Inbox routing rules (allow, block, filter)

MailSlurp has powerful inbox rulesets that can be attached to inboxes to allow control over which emails can be sent or receiving by an inbox. Rules allow wild card pattern matching such as:

See the inbox ruleset guide for more information.

Lifetime

All inboxes are permanent by default (provided your plan supports permanent inboxes). If you don't have a plan MailSlurp will expire inboxes after a default time for free users. For more information see expired inboxes guide. Emails that cannot be received due to a plan limit or an inbox ruleset are persisted as missed emails. These can be viewed in the dashboard or via the API so that you never lose an email.

How inboxes work

Once you create an inbox any email sent to the inbox's email address will be received by MailSlurp, parsed, and stored. Inboxes and emails are private and permanent (unless otherwise specified). Inboxes can also send emails and route mail with webhooks.