# Creating inboxes

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.

# Inboxes can:

  • have custom or randomly assigned email addresses
  • send emails and attachments
  • receive emails (sent to their email addresses)
  • permanently archive (inboxes do not expire)

# Creating an inbox

By default inboxes are assigned a randomly-generated email address ending in @mailslurp.com. For instance: 65b5ebf7f4fa@mailslurp.com.

const inbox = await mailslurp.createInbox();
// { id: '65b5ebf7f4fa', emailAddress: '65b5ebf7f4fa@mailslurp.com' }

You can specify custom email addresses by using a custom domain. For instance: invoices@myorg.com.

const inbox = await mailslurp.createInbox("invoices@myorg.com");
// 'invoices@myorg.com'

# Custom email addresses

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.

# 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.

Let's see it in action!