Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

email-stream

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-stream

Build a raw email with streams

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by600%
Maintainers
1
Weekly downloads
 
Created
Source

EmailStream

This is a very early release of something that I would welcome any help with. I appreciate that I am unlikely to have covered all of the RFCs that cover the email specifications. Please submit pull requests, issues and anything else.

EmailStream is a module to allow you to build a raw email stream from multiple streams.

Installation

npm install email-stream

Usage

var emailStream = require('email-stream');
var email = emailStream({
  to: 'test@example.com',
  from: 'test@example.org',
  subject: 'Test Subject',
  text: textStream,
  html: htmlStream
});

// Pipe the textStream
// Pipe the htmlStream
email.pipe(process.stdout);

Notes

A text stream is required for all emails and a HTML stream is optional

Attachments

If you want to add attachments to the email, add attachments: true to the initialisation function. Eg.

var email = emailStream({
  to: 'test@example.com',
  ...
  attachments: true
});

email.attach({
  filename: 'attachment.svg',
  type: 'text/svg',
  body: attachmentStream
});

email.attach({
  filename: 'attachment2.mp4',
  type: 'video/mp4',
  body: attachmentStream2
});

Keywords

FAQs

Package last updated on 22 Apr 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc