https://github.com/daemonraco/disposable-email-reader
A simple wrapper for some disposable email APIs.
https://github.com/daemonraco/disposable-email-reader
disposable-email maildrop nodejs
Last synced: 8 months ago
JSON representation
A simple wrapper for some disposable email APIs.
- Host: GitHub
- URL: https://github.com/daemonraco/disposable-email-reader
- Owner: daemonraco
- License: mit
- Created: 2017-07-14T18:28:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-17T14:43:00.000Z (over 8 years ago)
- Last Synced: 2025-01-08T06:36:12.631Z (10 months ago)
- Topics: disposable-email, maildrop, nodejs
- Language: JavaScript
- Size: 22.5 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Disposable Email Reader
A simple wrapper for some disposable email APIs. At the moment it supports:
* [Harakirimail.com](https://harakirimail.com)
* [MailDrop.cc](https://www.maildrop.cc)
* [Mailinator.com](http://www.mailinator.com)
## Installation
This module uses NPM and can be added to your project running this command
>npm install disposable-email-reader --save
## How to use it
This is an example of its usage:
```js
//
// Loading library.
var reader = require('disposable-email-reader');
//
// Creating a manager for a specific email.
var myInbox = new reader.HarakiriMail('mytemporaryemail');
//
// Listing all emais.
myInbox.list().subscribe(listResponse => {
//
// Walking over each email.
let list = listResponse.list();
for (let entryKey in list) {
let entry = list[entryKey];
//
// Retrieving an email.
myInbox.email(entry.id).subscribe(emailResponse => {
console.log("\nFrom: %s\nSubject: %s\n", emailResponse.from(), emailResponse.subject());
console.log("%s\n", emailResponse.body());
});
}
});
```
If you want to use something else instead of _HarakiriMail_, try one of these:
* _MailDrop_:
```js
var myInbox = new reader.MailDrop('mytemporaryemail');
```
* _Mailinator_:
```js
var myInbox = new reader.Mailinator('mytemporaryemail');
```
### Paging
If you want to get only 5 emails, but starting from the third page, you can do
something like this:
```js
myInbox.list(10, 5).subscribe(list => {
// ... my code
});
```
__Note__: These options may not be supported by certain services.
## Licence
MIT © [Alejandro Dario Simi](http://daemonraco.com)