Create email inboxes using MailSlurp's API

Create email inboxes using MailSlurp's API

You can create MailSlurp inboxes on demand using the API, dashboard or SDK libraries.

Randomized addresses

The simplest way to create an inbox is to use a createInbox() method. When passed no parameters MailSlurp will randomly assigned the inbox an email address ending in @mailslurp.com. The returned object looks like this:

{
  "id": "32f88182-3b6a-4f6e-8a53-59819931033a",
  "userId": "6f68f0cc-4760-4e82-87ad-449c9037773b",
  "created": "2019-12-06T13:04:13.998Z",
  "emailAddress": "32f88182-3b6a-4f6e-8a53-59819931033a@mailslurp.com"
}

In the above example the inbox's ID is 32f88182-3b6a-4f6e-8a53-59819931033a. The inbox's email address is 32f88182-3b6a-4f6e-8a53-59819931033a@mailslurp.com. Any emails sent to this address will be parsed and stored under that inbox ID.

Specific addresses

You can also create inboxes using specific addresses. Simply pass the address you wish to use as an emailAddress parameter. For example: createInbox('user1@mycompany.com')

Note specific email addresses must use a domain that you have created.

Lifespan

For most paid plans email addresses are permanent. Some unpaid options expire after a month. For automated tests it is recommended that you create new inboxes each test run and clean up afterwards using deleteInbox methods.

Next steps

Now lets look at how to receive emails with an inbox you have created.

Related content

Email APIs for Developers & QA

Build powerful applications and test suites using real email addresses in code. Create inboxes on demand then send and r...

Official MailSlurp documentation

Developer documentation and guides for MailSlurp's email APIs. REST, SDKS, Graphql, SMTP and more. MailSlurp is an email...

Ruby Mailer SDK - send and receive emails in Rails, Rspec an...

Receive email and attachments with Rails, Rspec, and Ruby without SMTP using MailSlurp Ruby Gem.

Temporary email api

Temporary email API for disposable email accounts. Free for personal use with REST API and clients in NodeJS, CSharp and...

Mailinator alternative

Alternatives to Mailinator for test email accounts. Create real email addresses using MailSlurp

Generate API clients using Swagger

How to create SDK libraries a language of your choice

Ready to dive in?Start building email applications today.