Email in code

Create real email addresses on demand. Send and receive email in Javascript, Ruby, PHP, Python, Java, and more. Built for developers and QA testers to build email functionality and test email related processes.

Example
Language
// install package with `npm install --save mailslurp-client`
import { MailSlurp } from "mailslurp-client"

// instantiate a client with API KEY
const mailslurp = new MailSlurp({ apiKey: 'your-api-key' })

// create an inbox with a random email address ending in @mailslurp.com
const { emailAddress, id } = await mailslurp.createInbox()
expect(emailAddress).toContain("@mailslurp.com")

// for full control over inbox email addresses use a custom domain
const customInbox = await mailslurp.createInbox("test@mydomain.com")

Documentation

MailSlurp has official libraries is several popular languages. We also have an easy to use REST API that you can call from any language. If you are looking for a no-code solution try our email dashboard.

SDK Library Documentation

  • MailSlurp javascript and typescript email library. Send and receive emails in NodeJS, React, Vue and more.

  • MailSlurp Zapier integration. Process new emails, attachments, and contacts from MailSlurp inboxes with Zapier.

  • Official MailSlurp Cypress JS plugin. Use real email accounts in Cypress to test user sign-up, email verification and more.

  • Email account API REST documentation for MailSlurp. Use HTTP client to send and receive emails from email APIs.

  • C++ MailSlurp library for embedded email processing. Email APIs for C and CPP. Send and download emails in C plus plus.

  • Crystal lang email API for MailSlurp. Generate email accounts in Crystal code and tests. Send and receive real emails.

  • CSharp ASP/DotNET email address library and SDK. Receive and send email from code and tests. Download emails and attachments in C#

  • CSharp NET Standard 2.1 email address library and SDK. Receive and send email from code and tests. Download emails and attachments in C#

  • Dart-lang email library for MailSlurp Pubspec. Dart Email API for creating email addresses in code or test that can send and receive real emails.

  • Email API library for Deno. Send and receive email in Deno tests and apps using hosted MailSlurp mailserver API.

  • Send and receive emails with Erlang, Elixir, and Phoenix. Official MailSlurp package on Hex.

  • Send and receive emails in Erlang

  • Create test email accounts in Golang. Send and receive emails in code and tests with Go and MailSlurp.

  • Javascript email library with GraphQL types for MailSlurp API.

  • Send and receive emails in Haskell

  • Java mailserver library create email addresses in Kotlin, Groovy, Java and more. Send and receive emails for code and tests.

  • Kotlin Email Library for testing and development. Create test email accounts in Java and Kotlin.

  • Lua email API for sending and receiving emails in tests and code.

  • Nim email API for creating test email accounts in Nim.

  • Objective C email library for iOS and Mac. Email API for Swift and Object C mailserver.

  • Send and receive emails in OCaml

  • Send and receive emails in Perl with MailSlurp

  • Create email addresses in Wordpress, Laravel, Symfony and more. Send and receive email and attachments in PHP.

  • Send and receive emails in Powershell

  • MailSlurp API Protobuf definitions

  • Python Email API for MailSlurp. Send and receive emails for test email accounts in Python.

  • Generate test email accounts in Ruby, Rspec, Cucumber and more. Send and receive emails in Rails and JRuby.

  • Rust email API library for MailSlurp. Send, read, download emails and attachments from code or tests in Rust with this crate.

  • Send and receive emails in Scala. Use MailSlurp test email accounts to create real inboxes in code and test apps.

  • Swift email library. Send emails in Swift and iOS. Download emails in Swift code and tests using MailSlurp's email API.

  • Typescript Email Library for creating test email accounts in Node without SMTP. Send and download emails in NodeJS using MailSlurps email API.

  • Receive emails, attachments, and new recipients by webhook. Contents sent to your server via HTTP POST.

Example Code

MailSlurp has many example projects hosted on GitHub and written about in the examples section.

Tutorials

Guides

  • Install and configure MailSlurp using SDK libraries or REST API.

  • How to create an inbox with MailSlurp to send and receive emails with.

  • Use regex or server side matching to extract email content

  • Read emails and attachments in code and tests. Wait for unread emails using long-polling or webhooks.

  • Use MailSlurp to test email related functionality using real email addresses.

  • Create an account and API Key. How to sign-up and login. Manage your settings and plan.

  • Use your api access token to call the MailSlurp API and control your inboxes remotely.

  • Send and receive email attachments.

  • Configure inbox forwarders to automatically forward received emails matching rules you setup.

  • List email addresses created in MailSlurp

  • How to use custom domains with MailSlurp.

  • Send and receive emails from custom domains using the MailSlurp web app.

  • How to create email address with wild-card catch all using MailSlurp. Screenshots included.

  • Check email addresses are real and exist using MailSlurp email verification.

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

  • See if emails are opened by sending tracking pixels. Receive open events via Webhook or view which recipients opened an email in the MailSlurp dashboard

  • Receive emails with http webhooks. Webhooks let you respond to inbound email streams in real time on your server or within an application.

  • Fetch and read emails with GraphQL inboxes using MailSlurp email API.

  • How to set inbox routing rules to block or allow inbound or outbound emails using patterns.

  • MailSlurp custom email address guide for catch all email routing.

  • Manage payment, access, and usage limits. How to upgrade, alter your subscription, and view invoices.

  • How to send emails and attachments in code and tests.

  • Email forwarding API for automatic email proxy. Setup auto-forwarding email aliases to mask a real email address.

  • Manage team access to email inboxes within an organization.

  • How to manage MailSlurp team access to an organization.

  • Free test email address for testing emails online with web dashboard or REST API.

  • How to wait for emails in code that match search criteria. Pattern matching and regular expressions.

Other