Socket
Socket
Sign inDemoInstall

catch-all

Package Overview
Dependencies
11
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    catch-all

A simple smtp catch all


Version published
Maintainers
1
Install size
13.4 MB
Created

Readme

Source

build status catch-all

A simple smtp-catch-all for your tests (node.js).

install

$ npm install catch-all

Usage

Simple usage:

var smtpCatchAll = require('..');
var server = smtpCatchAll.createServer();
server.on('newEmail', function (email) {
    console.log(email);
});
server.listen(4040);

Accessing the envelope:

var smtpCatchAll = require('..');
var server = smtpCatchAll.createServer();
server.on('newEmail', function (email, envelope) {
    console.log(envelope);
});
server.listen(4040);

catch-all is based on simplesmtp. You can pass same options to createServer

The returned server is also an instance of simplesmtp. You can listen to the same events
In the same way.

Email format

Email is just a simple json email like:

{ text: 'cuentame lo k ase',
headers: 
 [ { name: 'x-mailer',
     value: 'Nodemailer (0.5.3; +http://www.nodemailer.com/)' },
   { name: 'date', value: 'Tue, 12 Nov 2013 19:48:53 GMT' },
   { name: 'message-id',
     value: '<1384285733880.5b4d56c9@Nodemailer>' },
   { name: 'from', value: 'me@gmail.com' },
   { name: 'to', value: 'you@gmail.com' },
   { name: 'subject', value: 'ola k ase' },
   { name: 'content-type', value: 'text/plain; charset=utf-8' },
   { name: 'content-transfer-encoding', value: 'quoted-printable' },
   { name: 'mime-version', value: '1.0' } ],
subject: 'ola k ase',
messageId: '1384285733880.5b4d56c9@Nodemailer',
priority: 'normal',
from: [ { address: 'me@gmail.com', name: '' } ],
to: [ { address: 'you@gmail.com', name: '' } ],
date: Tue Nov 12 2013 20:48:53 GMT+0100 (CET) }

Keywords

FAQs

Last updated on 12 Nov 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc