MailSlurp is an Email API for developers and QA testers. It let's users create emails addresses on demand, then send and receive emails and attachments in applications and tests. MailSlurp is free for personal use.
- Create dynamic email accounts
- Receive emails with
waitFor(condition)
long-polling - Receive emails using Push WebHooks
- Send templated, transactional emails
This project contains the official and recommend MailSlurp SDK Client for Node, Javascript, and Typescript. All MailSlurp requests require API Authentication. Obtain a free API Key for personal use.
Resources | |
---|---|
📦 | NPM Module |
📖 | Documentation |
✍️ | Examples |
🎓 | Developer Portal |
🔑 | Get API Key |
Report an issue |
npm install --save mailslurp-client
// instantiate client
const MailSlurp = require('mailslurp-client').default;
const mailslurp = new MailSlurp({ apiKey: 'XXXXX' });
// create a new email address
const { emailAddress, id } = await mailslurp.createInbox();
// receive email using created inbox
const { subject, body } = await mailslurp.waitForLatestEmail(id);
// send email from inbox
await mailslurp.sendEmail(id, { to: ['xxxx@gmail.com'] })
// SEE DOCUMENTATION FOR ALL METHODS
This repository contains documentation for all methods. The client closely resembles the REST API. The REST API has detailed documentation at docs.mailslurp.com.
You can find more MailSlurp SDKs on our website. If you wish to call the REST API directly please see the HTTP Documentation.
See CHANGELOG.md.
Please email support and include a sample of the code you are using. Alternatively you can start a chat with our developers (note: responses may be asynchronous).