mai

mailinator

node mailinator api

Showing:

Popularity

Downloads/wk

44

GitHub Stars

6

Maintenance

Last Commit

3yrs ago

Contributors

4

Package

Dependencies

4

Size (min+gzip)

11.4KB

License

ISC

Type Definitions

Tree-Shakeable

No?

Categories

Readme

node-mailinator

node mailinator api.

Example

var mailinator = require('mailinator')({token: 'token-here'});

mailinator.getMessages('georgebush', function (err, messages) {
  console.log(messages);
  mailinator.readMessage(messages[0].id, function (err, res) {
    console.log(res);
  });
});

API

var mailinator = require('mailinator')(opts);

opts

An object of options:

  • opts.token is a token string from mailinator. Required.
  • opts.apiUrl is the base url for the api. Defaults to "https://api.mailinator.com/api/".
  • opts.to is the local part of an email address that mail was sent to. E.g. "obscure" would aquire the mail sent to obscure@mailinator.com

mailinator.getMessages(to, cb)

  • to is the local part of an email address that mail was sent to. If null, the default is opts.to.
  • cb(err, messages)
// whatever@mailinator.com
mailinator.getMessages("whatever", function (err, data) {
  console.dir(data); // => [{ id: '1420049469-71065803-whatever', ... }, ...]
})

mailinator.readMessage(msgId, cb)

  • msgId is the id of the desired message. E.g. "1420049469-71065803-whatever"
  • cb(err, message)
// whatever@mailinator.com
mailinator.readMessage("1420049469-71065803-whatever", function (err, data) {
  console.dir(data); // => { apiInboxFetchesLeft:697, apiEmailFetchesLeft: 10, ... }
})

License

ISC

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100