Skip to main content


MailSlurp can send and receive emails and attachments. Let us cover some common functions.

Sending emails

send email

To send emails first create an inbox. Then use the dashboard compose page or the sendEmail methods on the inbox controller.


Sending attachments

To send attachments first upload the attachment using the attachment controller:


Then send an email using the attachment ID.


Validating email recipients

You can verify recipients when sending emails:


See the verification guide for more options.

Use content templates

You can create email templates that support moustache style variables.


Then send email using the template and pass variables for replacement.


Sending with schedule

You can send email with a delay or scheduled delivery time like so:


Sending with queues

Use the sending queue to ensure emails are retried if they fail or your account experiences temporary limits.


Sending with SMTP/IMAP

Create an SMTP type inbox. Then use the IMAP or SMTP access details to access the inbox in code or from a mail client.


See the IMAP SMTP guide for more information.

Sent emails

Each sent email can be accessed with the SentEmail controller:


Delivery status

When emails are delivered an event is created. You can subscribe to delivery events using webhooks or view them in the dashboard.

Receiving emails

Inboxes receive emails. You can use the InboxController and EmailController to read email or use webhooks to have emails sent to your server directly.

Read emails in dashboard

The dashboard provides HTML previews for received emails:

Fetch emails in code

Emails are stored in the inbox that receives them. You can fetch emails directly using the inbox controller.


Download attachments

You can download attachments by using the attachment ID.


See the attachments page for more information.

Spam review

Every email is automatically scanned for viruses and spam ratings. You can access these on the email object.


Wait for emails

The email wait for methods allow you to hold a request open until matching emails are found. This is very useful for receiving emails in tests when after you have performed an action.


You can create complex search terms to match for email contents:


Receive email with webhooks

The best way to receive emails at scale is by using webhooks.