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

buildmail

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buildmail

buildmail is a low level rfc2822 message composer. Define your own mime tree, no magic included.

  • 1.2.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
294K
increased by20.24%
Maintainers
1
Weekly downloads
 
Created

What is buildmail?

The buildmail npm package is used for generating email messages in MIME format. It allows you to create complex email structures with attachments, HTML content, and alternative text versions.

What are buildmail's main functionalities?

Create a simple email

This feature allows you to create a simple email with basic fields like from, to, subject, and text content.

const BuildMail = require('buildmail');

const mail = new BuildMail({
  from: 'sender@example.com',
  to: 'recipient@example.com',
  subject: 'Hello World',
  text: 'Hello, this is a simple email.'
});

mail.build((err, message) => {
  if (err) throw err;
  console.log(message.toString());
});

Add HTML content

This feature allows you to add HTML content to your email, making it possible to send rich-text emails.

const BuildMail = require('buildmail');

const mail = new BuildMail({
  from: 'sender@example.com',
  to: 'recipient@example.com',
  subject: 'Hello World',
  html: '<h1>Hello, this is an HTML email.</h1>'
});

mail.build((err, message) => {
  if (err) throw err;
  console.log(message.toString());
});

Add attachments

This feature allows you to add attachments to your email, which can be any type of file.

const BuildMail = require('buildmail');
const fs = require('fs');

const mail = new BuildMail({
  from: 'sender@example.com',
  to: 'recipient@example.com',
  subject: 'Hello World',
  text: 'Hello, this email has an attachment.'
});

mail.attach({
  filename: 'file.txt',
  content: fs.createReadStream('path/to/file.txt')
});

mail.build((err, message) => {
  if (err) throw err;
  console.log(message.toString());
});

Other packages similar to buildmail

Keywords

FAQs

Package last updated on 15 Apr 2015

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