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

About

MailSlurp's API provides a simple and convenient way to create email addresses and mailboxes for your application. With MailSlurp, developers can easily create custom email inboxes and generate disposable email accounts to test email functionality in their applications.

To create an email address using MailSlurp's API, developers can send a POST request to the MailSlurp API endpoint with the desired parameters such as username and domain name. Once the email address is created, developers can use it to send and receive emails in their application. MailSlurp also provides features to fetch email contents, track email events, and automate email workflows.

In addition to custom email inboxes, MailSlurp allows developers to generate disposable email accounts for testing purposes. Disposable email accounts are temporary email addresses that can be used for testing without revealing the user's personal email address. This is particularly useful for developers who need to test their application's email functionality without exposing real email addresses to potential spam or other security risks.

To create a disposable email account using MailSlurp's API, developers can use the "createInbox" function and set the "expiresAt" parameter to a specific time or date. This will automatically delete the disposable email account after the specified time has elapsed, ensuring that the inbox is no longer accessible and the data is securely disposed of.

Overall, MailSlurp's API provides a powerful set of tools for developers to create custom email inboxes and generate disposable email accounts for testing purposes. By using MailSlurp, developers can streamline their testing workflows and ensure that their application's email functionality is fully functional and secure.

Randomized addresses

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

In the above example the inbox's ID is . The inbox's email address is . 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 parameter. For example:

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

Next steps

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