MailSlurp Examples 📨
Create email addresses on demand then send and receive emails in code and tests. Test apps end-to-end with real email addresses
This repository contains examples of MailSlurp usage with a range of different languages and frameworks. See the README.md or Makefile in each module for more information.
See developer page for more guides and documentation. If you notice an issue in the examples please open an issue, pull request, or contact support.
Start here
Use MailSlurp when your tests need real, private inboxes and phone numbers: each test gets its own address or number, waits for the message and reads the code, locally or in CI.
| Task | Example | Guide |
|---|---|---|
| Test sign-up, password reset and magic-link emails in Playwright | playwright-email-testing | Playwright email testing |
| Test email flows in Cypress | cypress-email-testing-starter | Cypress email testing |
| Test SMS two-factor login with a real phone number | playwright-sms-2fa-real-number | SMS OTP testing |
| Render email templates on real email clients in CI | email-rendering-ci | Device previews |
| Fail a build when Gmail or Outlook put your email in spam | inbox-placement-ci | Inbox placement |
Projects
- JavaScript-InboxPlacement-Test
- android-mailslurp-examples
- appwrite-email-otp
- appwrite-password-recovery
- appwrite-phone-auth
- better-auth-preview
- bruno-api-client
- bun-js-send-email
- clerk-email-verification
- csharp-dotnet-8
- csharp-dotnet-core-8-smtpclient
- csharp-dotnet-core2-selenium
- csharp-dotnet-core3
- csharp-dotnet-core7-nunit
- csharp-playwright-nunit-sms-otp
- csharp-smtp-client-xunit
- csharp-specflow-mstest-selenium
- curl-imap-smtp
- cypress-email-testing-starter
- dart-email-testing
- deno-email-api
- device-rendering
- documentation-device-rendering
- documentation-domains
- documentation-email-audit
- documentation-emails
- documentation-inbox-placement
- documentation-inboxes
- documentation-phones
- documentation-webhooks
- elixir-phoenix-hound
- email-rendering-ci
- firebase-cross-browser-email-link
- firebase-examples
- flutter-email-test
- fsharp-email-mstest
- golang-email-test
- golang-imap-examples
- golang-smtp-client-test
- http-accelq-email-otp-test
- hurl
- imap-smtp-examples
- inbox-placement-ci
- insomnia-test
- ios-swift-mailslurp-examples
- java-gradle-junit5
- java-jakarta-mail
- java-jmeter-loadtest
- java-jmeter-sms-deliverability-loadtest
- java-maven-junit-email-otp-match-test
- java-maven-junit4
- java-maven-selenium
- java-serenity-jbehave
- java-spring-boot
- java-testng-selenium
- javascript-axios
- javascript-codecept-js
- javascript-cypress-js
- javascript-cypress-js-open-email
- javascript-cypress-mailslurp-plugin
- javascript-cypress-newsletter-signup
- javascript-cypress-sms-testing
- javascript-device-render
- javascript-documentation-workflows
- javascript-email-screenshot
- javascript-jest-puppeteer
- javascript-react-email
- javascript-testcafe
- javascript-webdriver-io
- k6-email-load-test
- keycloak-email-verification
- kotlin-email-test-example
- mulesoft-anypoint-java-selenium-test
- mulesoft-anypoint-munit-otp-test
- n8n-email-otp-test
- next-auth-example
- nim-unittests
- nodejs-nodemailer-smtp-example
- nodejs-smtp-email-attachments-test
- php-codeception-acceptance
- php-composer-phpunit
- php-laravel-phpunit
- php-pest-wordpress-theme-test
- playwright-ai-email-testing
- playwright-codegen-recorder-nocode
- playwright-email-testing
- playwright-email-testing-starter
- playwright-lowcode-testing
- playwright-python-sms
- playwright-sms-2fa-real-number
- playwright-sms-testing
- powershell-email-send-ps1
- powershell-imap-smtp
- powershell-windows-cmd
- python-device-render
- python-locust-load-test
- python2-pytest
- python3-django-playwright
- python3-pyunit
- python3-robotframework
- readyapi-mailslurp-example
- rlang-email-sending-in-r
- ruby-capybara-cucumber-selenium
- ruby-cucumber-test
- ruby-minitest-netsmtp-example
- ruby-rspec
- rust-selenium-email-testing
- scala-gatling-loadtest
- scala-scalatest-email
- sendgrid
- supabase-account-security
- supabase-magic-link
- supabase-password-recovery
- swift-email-smtp-examples
- swift-xctest-example
- telnet-imap-smtp-sh
- totp-mfa-auth0-selenium
- uipath-email-otp-test
- visualbasic
- wait-for-methods-vitest
Running locally
If you wish to run these examples yourself:
- clone the repository.
- create an
.envfile in the root directory containingAPI_KEY=your-mailslurp-api-key. - to run an example
cdinto the directory and runmake testorAPI_KEY=your-api-key make test.
Static site
Examples are hosted statically on mailtesting.net. The site is built using Jeykll and hosted on GitHub pages. To update the site run make in the root directory. This will build the site. Commit the site and push to GitHub to update the live site.