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

ezymail

v3.0.0

Published

A simple and easy-to-use email sending library for Node.js.

Readme

ezymail

A lightweight email-sending package built from scratch using raw SMTP, TLS, and Node.js sockets.

No heavy dependencies. No SMTP wrappers. Just direct protocol-level email handling.


Features

  • Raw SMTP communication
  • TLS-secured email sending
  • Promise-based API
  • Supports plain text and HTML emails
  • Minimal and lightweight
  • Built for learning and experimentation

Installation

npm install ezymail

Usage

const ezymail = require("ezymail");


ezymail.send({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Test Email",  
  html: "<p>Hello from ezymail</p>",
  user: "[email protected]",
  pass: "your_app_password"
})
// For sequential/concurrent bulk mail sending :)
const data = {
  from: "[email protected]",
  subject: "Test Email",
  html: "<p>Hello from ezymail</p>",
  user: "[email protected]",
  pass: "your_app_password"
}
// "to" will automatically be taken from the users array

const users = [
  "[email protected]",
  "[email protected]"
]

// Make sure to use your SMTP email and app password
ezymail.sendseqmail(users, data, n)

// n = maximum number of mails to send (cap on the users array)
//
// Internally, mails are processed in batches of 20,
// with 5 mails sent concurrently within each batch.
//
// Example with 100 users, n = 60:
// -> only the first 60 users are processed
// -> split into 3 batches of 20
// -> each batch sends 5 mails at a time until the batch is done
// -> next batch starts only after the previous one completes
//
// sendseqmail takes each user from the users array,
// combines it with the provided data,
// and sends the mail to that respective user.

If you call the HTTP API directly, send valid JSON with double-quoted keys:

```json
{
  "from": "[email protected]",
  "to": "[email protected]",
  "subject": "Hello",
  "html": "<h1>Hello from ezymail</h1>"
}

Parameters

| Field | Type | Required | Description | |-----------|--------|----------|-------------| | from | string | Yes | Sender email address | | to | string | Yes | Recipient email address | | subject | string | Yes | Email subject | | html | string | Yes | Email content (sned html) | | user | string | Yes | SMTP username | | pass | string | Yes | SMTP password or App Password |


Gmail Setup

To use Gmail SMTP:

  1. Enable 2-Step Verification
  2. Generate an App Password
  3. Use the App Password instead of your real password

Google may block insecure or suspicious SMTP logins from some cloud platforms.


Example

const ezymail = require("ezymail");

ezymail.send({
  from: "[email protected]",
  to: "[email protected]",
  subject: "Hello",
  html: "<h1>Hello from ezymail</h1>",
  user: "[email protected]",
  pass: "your_app_password"
})

// For sequential/concurrent bulk mail sending :)
const data = {
  from: "[email protected]",
  subject: "Test Email",
  html: "<p>Hello from ezymail</p>",
  user: "[email protected]",
  pass: "your_app_password"
}

// "to" will automatically be taken from the users array
const users = [
  "[email protected]",
  "[email protected]"
]

// Make sure to use your SMTP email and app password
ezymail.sendseqmail(users, data, n)

// n = maximum number of mails to send (cap on the users array)
//
// Internally, mails are processed in batches of 20,
// with 5 mails sent concurrently within each batch.
//
// Example with 100 users, n = 60:
// -> only the first 60 users are processed
// -> split into 3 batches of 20
// -> each batch sends 5 mails at a time until the batch is done
// -> next batch starts only after the previous one completes
//
// sendseqmail takes each user from the users array,
// combines it with the provided data,
// and sends the mail to that respective user.

How It Works

ezymail manually implements the SMTP protocol:

  1. Connects to the SMTP server
  2. Establishes a TLS-secured connection
  3. Authenticates using AUTH LOGIN
  4. Sends SMTP commands directly
  5. Delivers the email
  6. Closes the connection

Deployment Notes

Some serverless platforms block outbound SMTP ports such as:

  • 25
  • 465
  • 587

Because of this, raw SMTP may not work on platforms like:

  • Vercel
  • Netlify
  • Cloudflare Workers

For production deployments, it is recommended to use:

  • VPS hosting
  • Dedicated servers
  • Or an API-based mail transport layer

Limitations

  • No attachments yet
  • No connection pooling
  • Basic SMTP parsing
  • Limited provider compatibility
  • SMTP ports may be blocked on some cloud platforms

Why This Package Exists

ezymail is primarily built for:

  • Learning how SMTP works internally
  • Understanding TLS and sockets
  • Exploring low-level networking
  • Building custom mail infrastructure

It is not intended to fully replace mature solutions like Nodemailer.


Security Notes

  • Never expose SMTP credentials publicly
  • Always use App Passwords instead of your real password
  • Do not hardcode credentials inside source code
  • Use environment variables in production

Example:

[email protected]
PASSWORD=your_app_password

License

MIT