Git Product home page Git Product logo

disposable-email-reader's Introduction

Disposable Email Reader

A simple wrapper for some disposable email APIs. At the moment it supports:

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:

//
// 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:
var myInbox = new reader.MailDrop('mytemporaryemail');
  • Mailinator:
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:

myInbox.list(10, 5).subscribe(list => {
    // ... my code
});

Note: These options may not be supported by certain services.

Licence

MIT © Alejandro Dario Simi

disposable-email-reader's People

Contributors

daemonraco avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

pallavi89

disposable-email-reader's Issues

Unable to read emails, error thrown

Hi,

I am trying to read Maildrop.cc email created by me, but everytime I run it, error is thrown as

../node_modules/rxjs/Subscriber.js:211
throw err;
^
[object Object]

Can you please help.

P.S: I didn't change the code, just ran it to verify if it is working fine but error keeps popping up

Edit

I did with HarakiriMail and received it like this:

HarakiriMailInboxWrapper {
  raw:
   { inbox: '[email protected]',
     skip: 0,
     limit: 10,
     total_count: 0,
     count: 0,
     emails: [] } }
[]

There was an email present but still it chose not to read, not sure why.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.