NodeJs library

Mail7 NodeJs library form disposable email service.

​ is a service that allows receiving emails at a temporary address that self-destructed after 24 hours. It is the most advanced throwaway email service that helps you avoid spam and stay safe in such cases.


npm i --save mail7


Replace the placeholders in the config object with your mail7 credentials apikey and apisceret. These can be obtained from here

var  config = {
     apiKey:  '<mail7 apikey>',
     apiSecret:  '<mail7 apisecret>'

Don't have Mail7 Account ? Create you own account here and get your apikey and apisecret

Require the mail7 package and pass the config object

var mail7 = require('mail7')(config);


mail7.getInboxByEmail("<[email protected]>").then((response) => {
}).catch((error) => {

The detailed document for apis parameters, body and output format, you can go through the mail7 documents

Inbox APIs:


  • @param {string} to - full email address or username for example testme or [email protected]
  • @param {string} mesgid - the id of particular email object
  • @param {string} domain - the domain name email is created by

As mail7 support custom domain, so you can use any email like [email protected]. But you no need to pass this domain explicitly in function param as domain will be fetched from email. But make sure that your mail7 plan included the custom domain email addresses

Routing Rules APIs:


  • @param {object} data - json object for roles need to be create
  • @param {string} ruleName - rule to be delete

If only username testme is passed then it will be treated as default domain email like [email protected]

It is suggested that pass full email address for any other domain like [email protected]