mailbin

1.0.1 • Public • Published

Mailbin client

NodeJS client for http://mailb.in

Installation

$ npm install mailbin --save

Or with Yarn

$ yarn add mailbin

Usage

const nodemailer = require('nodemailer');
const mailbin = require('mailbin');

const smtp = nodemailer.createTransport('smtps://username%40gmail.com:password@smtp.gmail.com');

describe('send', function(){
  this.timeout(5000);

  let bin = mailbin.nextBin('test');

  it('should send', () => {
    return smtp
      .sendMail({
        from: 'username@gmail.com',
        to: bin.email,
        subject: 'Hello!',
        text: 'Hello!',
        html: '<b>Hello!</b>'
      })
      .then(() => bin.fetchMessage())
      .then(message => {
        expect(message.subject).to.be.eql('Hello!');
      });
  });
});

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i mailbin

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • chaliy