Videos
Check out our tutorial video series.
Sending & Receiving Emails in Javascript made easy with Axios using MailSlurp API. Learn how to automate email testing and stay productive!
Axios is a popular HTTP request library for Javascript and NodeJS. It lets you fetch webpages and call APIs from the browser and NodeJS in a reliable and friendly way. With a MailSlurp account Axios can also send and receive emails!
You can install Axios from NPM as follows:
Making a request is easy once installed:
MailSlurp is a free email API. You can create email addresses on demand then send and receive emails from Javascript. You can create a free account then use the API Key to send and receive emails with Axios.
To use MailSlurp with Axios first import the library and your API Key.
First we can create an email address like so:
MailSlurp inboxes have real email addresses than can send and receive email.
Sending an email is easy with Axios and MailSlurp. Simple data to
.
Include your API Key as a query parameter:
.
You can receive emails with MailSlurp too!
You can use Axios and MailSlurp for all your email needs. Sending, receiving, or even end-to-end testing.
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.