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
Send email with Axios JS (and receive email too!)
Send email in Javascript with MailSlurp email API
Email attachments API to send and download attachments in co...
Use MailSlurp's attachment endpoints to upload, send, receive, and download attachments.
Create and view inboxes
List email addresses created in MailSlurp
Using custom domains with MailSlurp
Email custom domains with API access
Create email inboxes using MailSlurp's API
Create email inboxes using MailSlurp's API
MailSlurp API entities and how to use them
MailSlurp API entities and how to use them
Get emails from code (how to receive emails programmatically...
How to receive emails directly in code, applications, and tests. Use MailSlurp to send and receive SMTP emails.
Sending email in Javascript and NodeJS (Typescript examples)
Sending email in Javascript and NodeJS (Typescript examples)