1.0.1 • Published 4 years ago

pipe-mail v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Build Status

pipe-mail

A command-line tool to send e-mails via SMTP from the standard input.

Prerequisites

Node.js 7 or above.

Installation

npm install -g pipe-mail

Examples

You can directly send an e-mail from the command line:

echo "Hello world!" | pipe-mail -s Subject -o smtp.fastmail.com -u myusername -p mypassword fromaddress@fastmail.com toaddress@fastmail.com

If you don't want to specify the server options every time, you can set them as environment variables:

export PIPEMAIL_SMTP_HOST=smtp.fastmail.com
export PIPEMAIL_SMTP_USER=myusername
export PIPEMAIL_SMTP_PASSWORD=mypassword
echo "Hello world!" | pipe-mail fromaddress@fastmail.com toaddress@fastmail.com

You can feed any file to it to send the content via e-mail:

echo "Hello world!" > email.txt
pipe-mail fromaddress@fastmail.com toaddress@fastmail.com < email.txt

Usage

$ pipe-mail --help

  Usage: pipe-mail [options] [from-email-address] <recipient-email-address>

  Options:

    -V, --version              output the version number
    -s, --subject <subject>    e-mail subject
    -o, --host <host>          SMTP server host
    -r, --port <port>          SMTP server port. Defaults to 485 if SSL is in use, 587 if not
    -n, --no-ssl               Don't use SSL when connecting to the SMTP server
    -t, --html                 Send message as HTML
    -u, --user <user>          SMTP login username
    -p, --password <password>  SMTP login password
    -h, --help                 output usage information

Environment Variables

Some options can be specified via environment variables:

  • PIPEMAIL_SMTP_HOST
  • PIPEMAIL_SMTP_PORT
  • PIPEMAIL_SMTP_USER
  • PIPEMAIL_SMTP_PASSWORD
  • PIPEMAIL_FROM : From e-mail address. If this is set, the "from-email-address" argument can be omitted

Contributing

Feel free to report any issues or submit PRs via github

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

  • This module is a wrapper around nodemailer, a comprehensive Node.js module to send e-mails
  • This talk by Justin Searls (@searls) was source of inspiration for unit testing. The testdouble.js library makes the work straightforward
  • Another nodemailer cli tool, nodemailer-cli was also source of inspiration
1.0.1

4 years ago

1.0.0

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago