Temporary email api

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

Looking for a temporary email address API? MailSlurp has a free service for creating email accounts using the temp mail api. Create a free account to obtain an api access key then install one of the official temp email clients or call the API in HTTP or GraphQL.

inbox-tool

Create temporary email accounts

If you need accounts for testing applications or email processes MailSlurp's free temp mail api can be used to create real email addresses on demand. Each inbox has an email address that can send and receive emails. You can control inboxes using the API or one of the official clients in your programming language. Let us see an example.

Setup NodeJS client

Install with npm if you use Javascript or find another client on the developer page.

npm install --save mailslurp-client

Next import the client into code or tests and set your API KEY.

// import mailslurp-client
const MailSlurp = require('mailslurp-client').default;
// OR import { MailSlurp } from "mailslurp-client"

// create a client
const apiKey = process.env.API_KEY ?? 'your-api-key';
const mailslurp = new MailSlurp({ apiKey });

Create an inbox

Use the createInbox method in the temp mail api to create an inbox:

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

Sending emails

Send emails from your temp mailbox using the sendEmail method:

await mailslurp.sendEmail(inbox.id, {
  to: [inbox.emailAddress],
  subject: 'test',
});

Read emails using API

You can read emails that your inboxes receive using the waitFor commands:

// wait for first email
const latestEmail = await mailslurp.waitForLatestEmail(inbox.id, timeoutMs);
expect(latestEmail.subject).toContain('test');

Get started today

MailSlurp is free for personal use and offers simple pricing for companies. Please see code examples and developer docs for more information.

Related content

API Reference

Build powerful applications and test suites using real email addresses in code. Create inboxes on demand then send and receive emails and attachments in Javascript, Go, PHP, Ruby, Java, C#, REST and more.

Official MailSlurp documentation

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

Ruby Mailer SDK - send and receive emails in Rails, Rspec and more using MailSlurp's official email Gem

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

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

Using Attachments

Use MailSlurp's attachment endpoints to upload, send, receive, and download attachments.

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)

Ready to dive in?Start building email applications today.