npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

smtpsend-cli

v1.0.1

Published

A simple and lightweight CLI tool to send emails via SMTP

Readme

smtpsend-cli

A simple and lightweight CLI tool to send emails via SMTP from the command line.

Installation

npm install -g smtpsend-cli

Usage

Basic Usage

smtpsend --host smtp.gmail.com --port 587 --user [email protected] --password your-password --to [email protected]

With Subject and Text

smtpsend \
  --host smtp.gmail.com \
  --port 587 \
  --user [email protected] \
  --password your-password \
  --to [email protected] \
  --subject "Hello from CLI" \
  --text "This is the email body"

With HTML Content

smtpsend \
  --host smtp.gmail.com \
  --port 587 \
  --user [email protected] \
  --password your-password \
  --to [email protected] \
  --subject "HTML Email" \
  --html "<h1>Hello</h1><p>This is HTML content</p>"

Using Environment Variables

Create a .env file or export environment variables:

export SMTP_HOST=smtp.gmail.com
export SMTP_PORT=587
export SMTP_SECURE=false
export [email protected]
export SMTP_PASSWORD=your-password
export [email protected]

Then you only need to specify --to:

smtpsend --to [email protected]

Options

| Option | Short | Description | Required | Default | |--------|-------|-------------|----------|---------| | --to | -t | Recipient email address | ✅ Yes | - | | --host | -h | SMTP host | ✅ Yes* | SMTP_HOST env var | | --port | -p | SMTP port | No | 587 or SMTP_PORT env var | | --secure | -s | Use secure connection (true/false) | No | false or SMTP_SECURE env var | | --user | -u | SMTP username | ✅ Yes* | SMTP_USER env var | | --password | -w | SMTP password | ✅ Yes* | SMTP_PASSWORD env var | | --from | -f | From email address | No | SMTP_FROM env var or --user value | | --subject | - | Email subject | No | Test Email | | --text | - | Email text content | No | This is a test email sent via smtpsend CLI. | | --html | - | Email HTML content | No | - |

* Required if not set via environment variables

Examples

Gmail

smtpsend \
  --host smtp.gmail.com \
  --port 587 \
  --user [email protected] \
  --password your-app-password \
  --to [email protected]

Note: For Gmail, you need to use an App Password instead of your regular password.

Outlook

smtpsend \
  --host smtp-mail.outlook.com \
  --port 587 \
  --user [email protected] \
  --password your-password \
  --to [email protected]

SendGrid

smtpsend \
  --host smtp.sendgrid.net \
  --port 587 \
  --user apikey \
  --password YOUR_SENDGRID_API_KEY \
  --from [email protected] \
  --to [email protected]

Mailgun

smtpsend \
  --host smtp.mailgun.org \
  --port 587 \
  --user YOUR_MAILGUN_SMTP_USER \
  --password YOUR_MAILGUN_SMTP_PASSWORD \
  --to [email protected]

Common SMTP Providers

| Provider | Host | Port | Secure | |----------|------|------|--------| | Gmail | smtp.gmail.com | 587 | false | | Gmail (SSL) | smtp.gmail.com | 465 | true | | Outlook | smtp-mail.outlook.com | 587 | false | | Yahoo | smtp.mail.yahoo.com | 587 | false | | SendGrid | smtp.sendgrid.net | 587 | false | | Mailgun | smtp.mailgun.org | 587 | false |

Requirements

  • Node.js >= 18.0.0

License

MIT