disposable-mail-api
v0.1.0
Published
Generate multiple disposable mails
Downloads
9
Maintainers
Readme
Installation
npm i disposable-mail-api
Examples
Basic Usage
The library is very easy to use, we can create a fully functional mail on the internet with the code shown below and we will be able to receive and consult the entire inbox.
const {DisposableMail} = require('disposable-mail-api');
const mail = new DisposableMail();
(async () => {
const createMail = await mail.generate({mail: 'MySuperFakeEmail'}); // => {addres: '[email protected]'}
const getInboxMail = await mail.inbox({withHtml: true}); // => mailInbox: [{from: [{address: '[email protected]', name: 'John Doe'}], intro: 'Mail content!', subject: 'important mail'}]
})();
CLI Usage
Install disposable-mail-api in global context
npm i -g disposable-mail-api
And then you can run:
disposable-mail-api -u myrandomusername --html
This will show an interface in which you can receive mails without this need of code, something like this:
Mail created => [email protected]
Listening for mails...
---------------------------- NEW MAIL ----------------------------
>> From: John Doe <[email protected]>
>> Subject: Testing mail server.
>> Intro: Awesome mail system.
>> Body: Awesome mail system.
---------------------------- NEW MAIL ----------------------------
>> From: Not Jonh Doe <[email protected]>
>> Subject: Not John Doe speaking!
>> Intro: You know.... im not John Doe, im J...
>> Body: You know.... im not John Doe, im Jonh Doe!