Videos
Check out our tutorial video series.
How to receive emails directly in code, applications, and tests. Use MailSlurp to send and receive SMTP emails.
Once you have created an inbox any emails sent to its email address received and saved under the inboxes ID. MailSlurp allows you to fetch and receive emails send to an inbox's email address in several ways:
The simplest way to receive emails is to create an inbox and send it an email using your email provider. You can then view the emails in your dashboard.
If you know that an email exists and you have its simply call a
method to get a full email object that includes the body.
For programmatic use-cases the MailSlurp API and SDKs provide WaitFor methods. This is the recommended way to receive emails.
WaitFor methods hold a connection until a condition is met. If the condition is met a list of matching entities is returned. These contain email
values that can be used to fetch individual emails.
There are several variations:
You can fetch all existing emails from an inbox with the methods. These methods return a collection of
.
To get the body or attachments for an email you must call or
methods individually.
WebHooks are a way to be notified via HTTP POST when a message is received. If you attach a WebHook to an inbox the WebHook URL will be notified when a new email is received. WebHooks are useful for high throughput applications or for environments where WaitFor methods are not appropriate.
Whenever MailSlurp receives email it extras attachments and stores them securely to disk. Attachments are not returned directly when emails are fetched. Instead you must obtain the attachment IDs from an email and then call attachment methods to receive attachment metadata and binary content.
Check out our tutorial video series.
Email and SMS guides for automation and testing.
View github project code for multiple languages.
Latest posts from the MailSlurp team.
Test, build, and automate messaging with a free MailSlurp account.