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

sendmail

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sendmail

Sendmail without setting up SMTP server

  • 1.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is sendmail?

The sendmail npm package is a simple way to send emails from your Node.js application without needing a dedicated SMTP server. It uses the sendmail command available on Unix-like systems to send emails.

What are sendmail's main functionalities?

Send a basic email

This feature allows you to send a basic email with a subject and HTML content. The sendmail function is called with an options object containing the email details.

const sendmail = require('sendmail')();
sendmail({
  from: 'no-reply@yourdomain.com',
  to: 'user@example.com',
  subject: 'Test Email',
  html: 'This is a test email',
}, function(err, reply) {
  console.log(err && err.stack);
  console.dir(reply);
});

Send an email with attachments

This feature allows you to send an email with attachments. The attachments property is an array of objects, each representing a file to be attached to the email.

const sendmail = require('sendmail')();
sendmail({
  from: 'no-reply@yourdomain.com',
  to: 'user@example.com',
  subject: 'Test Email with Attachment',
  html: 'This is a test email with an attachment',
  attachments: [
    {   // file on disk as an attachment
      filename: 'text1.txt',
      path: '/path/to/file.txt' // stream this file
    }
  ]
}, function(err, reply) {
  console.log(err && err.stack);
  console.dir(reply);
});

Other packages similar to sendmail

Keywords

FAQs

Package last updated on 05 Jul 2019

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