Overview
Understand the MailSlurp docs surface, core platform pillars, and the fastest path into email, SMS, testing, monitoring, and automation.
MailSlurp gives your team real inboxes, phone numbers, event hooks, testing tooling, monitoring, and governance controls in one platform. Use this page to choose the right docs path first, then jump into the workflow closest to your job.
Choose the docs path that matches your job
- Quick start for the shortest hands-on path from API key to first inbox or phone number.
- Features hub if you want to browse the platform by capability instead of by endpoint.
- Guides hub if you know the workflow you want but not the right MailSlurp page yet.
- API reference and SDK libraries if you are implementing directly in code.
- Examples, Postman, Bruno, and Insomnia if you want runnable clients and API collections.
Start by team
DevelopersCreate inboxes, domains, and numbers in code so product workflows stop depending on shared mailboxes.
QA and releaseTest sign-up, OTP, notifications, and message quality using deterministic waits and delivery checks.
MarketersPreview campaigns, audit email quality, and monitor sender or campaign health before and after launch.
Data and opsCapture inbound messages, extract structured content, and route events into downstream systems.
Browse the platform by capability
MessagingCore inboxes, email, SMS, custom domains, attachments, and external mailbox connectors.Browse messaging
TestingEnd-to-end release confidence with waits, device previews, email audit, compatibility checks, and deliverability tests.Open testing guide
MonitoringMonitor domains, live campaigns, and sender health so issues are visible before customers notice them.Open monitoring
AutomationUse webhooks, forwarding, routing rules, alias proxy, and AI transformers to turn messages into events and data pipelines.Open automation
GovernanceShare access safely with organizations, custom roles, environment isolation, SAML SSO, and storage controls.Open governance
Key docs in each pillar
Messaging
- Inboxes for creating isolated email addresses for apps, tests, and automations.
- Emails for sending, receiving, previewing, and inspecting messages.
- TXT/SMS for real phone numbers and OTP or notification flows.
- Attachments for file upload, download, and processing.
- Custom domains and Plus addresses for production-style address management.
- External mailboxes and IMAP / SMTP for integrating with existing mailbox infrastructure.
Testing and QA
- Testing for integration and end-to-end message workflows.
- Wait for methods for deterministic email and SMS assertions without sleeps.
- Device previews, Email audit, and Email compatibility for release confidence.
- Deliverability tests for pass/fail checks across inbox or phone cohorts.
- Test interface and framework guides such as Playwright and Selenium for concrete test implementations.
- MFA/TOTP devices when authentication flows include one-time codes.
Monitoring
- Monitoring for the overall post-launch monitoring surface.
- Domain Monitor for DNS posture and sender-health drift.
- Campaign Probe for live campaign capture and review.
- Reputation for bounce, complaint, and suppression-aware sender protection.
Automation
- Webhooks for event-driven integrations.
- Routing rules for allow or block logic on inbound traffic.
- Forwarding and Auto reply for operational mailbox workflows.
- Alias proxy for masked address routing.
- AI transformers and AI results for turning messages and attachments into structured data.
Team and governance
- Organizations for shared team accounts.
- Roles and permissions for custom roles and per-user access control.
- Environments for staging and production separation.
- SAML SSO for identity-provider based sign-in.
- Storage for retention and lifecycle expectations.
- Guest portals when external users need controlled access.
Developer tooling
- Authentication for API key setup and safe auth patterns.
- API reference for endpoint groups and request models.
- SDK libraries and language docs such as JavaScript, Python, Java, C#, and Go.
- Pagination for safe list and sync loops.
- Postman, Bruno, and Insomnia for API collection workflows.
- Examples for end-to-end reference implementations.
How MailSlurp fits together
Most teams follow the same flow:
- Provision a fresh inbox, phone number, or mailbox connection.
- Run the workflow that should send or receive a real message.
- Inspect the message synchronously with wait methods or asynchronously with webhooks.
- Add monitoring, access controls, and environment separation as the workflow moves toward production.
Get an SDK running
Start with an SDK setup snippet in your language. The same workflows are also available over the REST API.
Javascript
// create mailslurp client
const { MailSlurp } = require('mailslurp-client');
const mailslurp = new MailSlurp({ apiKey: process.env.API_KEY });
// create inboxes
const inbox1 = await mailslurp.createInbox();
const inbox2 = await mailslurp.createInbox();
// send email
await mailslurp.sendEmail(inbox1.id, {
to: [inbox2.emailAddress],
subject: "Test",
body: "<span>Hello 👋",
isHTML: true
})
// receive email using wait methods
const email = await mailslurp.waitForLatestEmail(inbox2.id, 60000, true)
expect(email.body).toContain("Hello")
// list emails in inbox
const emails = await mailslurp.inboxController.getInboxEmailsPaginated({inboxId: inbox2.id})
expect(emails.numberOfElements).toEqual(1)
C#
// create client
var config = new Configuration();
config.ApiKey.Add("x-api-key", ApiKey);
// create inboxes
var inboxControllerApi = new InboxControllerApi(config);
var inbox1 = inboxControllerApi.CreateInbox();
var inbox2 = inboxControllerApi.CreateInbox();
// send email
inboxControllerApi.SendEmail(inbox1.Id, new SendEmailOptions(
to: new List<string> { inbox2.EmailAddress },
subject: "Test CSharp",
body: "<span>Hello",
isHTML: true
));
// receive email with wait controller
var email = new WaitForControllerApi(config).WaitForLatestEmail(inbox2.Id, 60000, true);
StringAssert.Contains(email.Body, "Hello");
// list emails in inbox
var emails = inboxControllerApi.GetInboxEmailsPaginated(inbox2.Id);
Assert.AreEqual(emails.TotalElements, 1);
Go
// create a context with your api key
ctx := context.WithValue(context.Background(), mailslurp.ContextAPIKey, mailslurp.APIKey{Key: apiKey})
// create mailslurp client
client := mailslurp.NewAPIClient(mailslurp.NewConfiguration())
// create inboxes
inbox1, _, err := client.InboxControllerApi.CreateInbox(ctx, &mailslurp.CreateInboxOpts{})
inbox2, _, err := client.InboxControllerApi.CreateInbox(ctx, &mailslurp.CreateInboxOpts{})
assert.Nil(t, err)
// send email from inbox 1 to inbox 2
_, err = client.InboxControllerApi.SendEmail(ctx, inbox1.Id, mailslurp.SendEmailOptions{
To: []string{inbox2.EmailAddress},
Subject: "Test",
Body: "<span>Hello",
IsHTML: true,
})
assert.Nil(t, err)
// now receive the email at inbox 2
email, _, err := client.WaitForControllerApi.WaitForLatestEmail(ctx, &mailslurp.WaitForLatestEmailOpts{
InboxId: optional.NewInterface(inbox2.Id),
Timeout: optional.NewInt64(60000),
UnreadOnly: optional.NewBool(true),
})
assert.Nil(t, err)
assert.Contains(t, email.Body, "Hello")
// list emails
emails, _, err := client.InboxControllerApi.GetInboxEmailsPaginated(ctx, inbox2.Id, nil)
assert.Nil(t, err)
assert.Equal(t, emails.TotalElements, int64(1))
Java
// create client
ApiClient client = Configuration.getDefaultApiClient();
client.setApiKey(apiKey);
client.setHttpClient(httpClient);
// create inboxes
InboxControllerApi inboxControllerApi = new InboxControllerApi(client);
InboxDto inbox1 = inboxControllerApi.createInboxWithDefaults().execute();
InboxDto inbox2 = inboxControllerApi.createInboxWithDefaults().execute();
// send email
SendEmailOptions sendOptions = new SendEmailOptions();
sendOptions.setTo(Collections.singletonList(inbox2.getEmailAddress()));
sendOptions.setSubject("Test");
sendOptions.setBody("<span>Hello");
sendOptions.setIsHTML(true);
inboxControllerApi.sendEmail(inbox1.getId(), sendOptions);
// receive email with wait for controller
Email email = new WaitForControllerApi(client).waitForLatestEmail().inboxId(inbox2.getId()).timeout(60000L).unreadOnly(true).execute();
assertEquals(email.getBody().contains("Hello"), true);
// list emails in inbox
PageEmailPreview emails = inboxControllerApi.getInboxEmailsPaginated(inbox2.getId()).execute();
PHP
// configure client with api key
$config = MailSlurp\Configuration::getDefaultConfiguration()
->setApiKey('x-api-key', getenv('API_KEY'));
// create an inbox controller with config
$inboxController = new MailSlurp\Apis\InboxControllerApi(null, $config);
// create inboxes
$inbox1 = $inboxController->createInbox();
$inbox2 = $inboxController->createInbox();
// send an email
$inboxController->sendEmail($inbox1->getId(), new \MailSlurp\Models\SendEmailOptions(array(
'to' => array($inbox2->getEmailAddress()),
'subject' => 'Test email',
'body' => '<span>Hello 👋',
'is_html' => true
)));
// wait for email
$waitForController = new MailSlurp\Apis\WaitForControllerApi(null, $config);
$email = $waitForController->waitForLatestEmail($inbox2->getId(), 60_000, true);
PHPUnit\Framework\Assert::assertStringContainsString("Hello", $email->getBody());
// list emails in inbox
$emails = $inboxController->getInboxEmailsPaginated($inbox2->getId());
PHPUnit\Framework\Assert::assertEquals(1, $emails->getTotalElements());
Python
import mailslurp_client
# create a mailslurp configuration
configuration = mailslurp_client.Configuration()
configuration.api_key['x-api-key'] = api_key
with mailslurp_client.ApiClient(configuration) as api_client:
# create an inbox
inbox_controller = mailslurp_client.InboxControllerApi(api_client)
inbox_1 = inbox_controller.create_inbox()
inbox_2 = inbox_controller.create_inbox()
# send email
opts = mailslurp_client.SendEmailOptions()
opts.to = [inbox_2.email_address]
opts.subject = "Hello"
opts.body = "Email content <strong>supports HTML</strong>"
opts.is_html = True
inbox_controller.send_email(inbox_1.id, send_email_options=opts)
# receive email with wait controller
wait_controller = mailslurp_client.WaitForControllerApi(api_client)
email = wait_controller.wait_for_latest_email(inbox_id=inbox_2.id, timeout=60000, unread_only=True)
# assert that the message was received
assert email.inbox_id == inbox_2.id
assert email.subject == "Hello"
assert "Email content" in email.body
# list emails in inbox
emails = inbox_controller.get_inbox_emails_paginated(inbox_2.id)
assert len(emails.content) >= 1
Ruby
# configure mailslurp client
MailSlurpClient.configure do |config|
config.api_key['x-api-key'] = API_KEY
end
# create inboxes
inbox_controller = MailSlurpClient::InboxControllerApi.new
inbox_1 = inbox_controller.create_inbox
inbox_2 = inbox_controller.create_inbox
# send an email
inbox_controller.send_email(inbox_1.id,{
to: [inbox_2.email_address],
subject: 'Test',
isHTML: true,
body: '<h1>Hello!</h1>'
})
# receive email with wait controller
wait_controller = MailSlurpClient::WaitForControllerApi.new
email = wait_controller.wait_for_latest_email({ inbox_id: inbox_2.id, timeout: 60000 })
expect(email.body).to include("Hello")
# list inbox emails
emails = inbox_controller.get_emails(inbox_2.id)
expect(emails.length).to be(1)
Representative code samples
Examples below use JavaScript because the snippets are shortest there. The same flows exist across the SDKs and direct HTTP API.
Create an inbox
// create an inbox
const inbox = await mailslurp.inboxController.createInboxWithDefaults();
expect(inbox.emailAddress).toMatch(/.+@.+/);
Wait for a real email
// send an email
await mailslurp.inboxController.sendEmailAndConfirm({
inboxId: inbox.id,
sendEmailOptions: {
to: [inbox.emailAddress],
subject: "First email",
}
})
// wait for the first unread email to arrive
const email = await mailslurp.waitController.waitForLatestEmail({
timeout: 120_000,
inboxId: inbox.id,
unreadOnly: true
})
expect(email.subject).toContain('First email')
Push events to your server
const inbox = await mailslurp.createInbox();
const webhook = await mailslurp.webhookController.createWebhook({
inboxId: inbox.id!,
createWebhookOptions: {
eventName: CreateWebhookOptionsEventNameEnum.NEW_EMAIL,
url: testEndpoint.url!!,
},
});
Add SMS coverage
const phone = await mailslurp.phoneController.createPhoneNumber({
createPhoneNumberOptions: {
name: 'Sales inbound',
phoneCountry: CreatePhoneNumberOptionsPhoneCountryEnum.US,
}
})
expect(phone.phoneNumber).toContain('+1')
What to read next
- Building product messaging flows: Inboxes, Emails, Custom domains, and Verification.
- Shipping release checks: Testing, Wait for methods, Device previews, and Deliverability tests.
- Automating downstream actions: Webhooks, Forwarding, Routing rules, and AI transformers.
- Rolling out to teams safely: Organizations, Roles and permissions, Environments, and Storage.