Videos
Check out our tutorial video series.
Programmatically test your apps end-to-end with realistic emails using MailSlurp. Learn how with their REST API and SDKs in multiple languages.
Many applications send emails. They may be sent when a user signs up, or as part of a monthly newsletter. Whatever the reason, emails are essential for many programmers. As most developers use transactional email services, testing applications end-to-end can hit a wall when emails enter the picture.
For many use cases the need for real and unique email addresses arises.
While you can test an app once using your own email address if you want to add that test case to an automated test suite you will need programmatic access to an email address to send and receive the real emails with.
Luckily services like MailSlurp let you generate test email addresses on demand via a simple API. You can then send and receive real email using the address from within your tests.
If we want to test email sending and receiving end-to-end we need to generate a new email address during a test method. MailSlurp provides an official Javascript client that is easy to use. Here is an example of a test written in Javascript to demonstrate the key points.
Let's imagine an application that sends emails when a user signs up. To test that we need a test that creates a new email address and uses that account to sign up for our app. Then we verify that a welcome email was received.
Let's look at the code
Test email accounts like MailSlurp let you test every aspect of your application. With MailSlurp you can create unlimited email addresses that are private and unique. You can then send and receive emails via REST API or official SDKs in several languages. For more information check out the documentation
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.