A command line interface for sending email, wrapped around nodemailernodemailer.
InstallationInstall the module globally to expose the
nodemailercommand to your environment.
npm install -g nodemailer-cli
$ nodemailer --help Usage: nodemailer <to> <from> [bodyText] [options] to Email address, or comma separated list of email addresses to send mail to. from Email address that the message should be from. bodyText The plaintext message body. Options: -t, --service The nodemailer service identifier, if any. -u, --username The SMTP username to use when authenticating. [local_user_name] -p, --password The plain-text password to use when authenticating. -s, --server The SMTP server that mail will be delivered to. -r, --port The port to use when contacting the SMTP server. -n, --nossl If set, SSL will not be used when sending mail. -j, --subject The string to be used as the email's subject. --cc An email address to Carbon Copy. List multiple recipients by appending multiple --cc parameters. --bcc An email address to Blind Carbon Copy. List multiple recipients by appending multiple -bcc parameters. --replyTo An email address that should receive replies if a recipient replies to your message. --body A file to use as the message body. --attachment A path to a file that should be attached. List multiple attachments by appending multiple --attachment parameters. -v, --version Print version and exit.
Environment VariablesSome environment variables can be used in place of CLI options. CLI options override these environment variables, if used, so these can be thought of as defaults.
- SMTPSERVER The hostname of the SMTP server to be used.
- SMTPPORT The port on the SMTP server that should be connected to.
- SMTPUSERNAME The username to use when authenticating.
- SMTPPASSWORD The password to use when authenticating.
- SMTPUSESSL Set this to a truth-y value to use SSL.
- SMTPUSETLS Set this to a truth-y value to use TLS (STARTTLS)
- SMTPSERVICENAME This is one of nodemailer's service identifiers, if you
- Updates to support multiple `--attachment` parameters — _[@mistralol]_
- Fixes typo that would cause env vars to be ignored for useTLS — _[@mistralol]_
- Package Updates, fixes — _[@mistralol]_, [#6](https://github.com/fardog/nodemailer-cli/pull/6) - Increased minimum node version to 4 - Added option to ignore STARTTLS - Added option to ignore certificate - Fix missing server alias from the command line - Bring all deps up to current versions - Reformat README — _[@fardog]_
- Fixes `undefined` being passed for auth when no auth is specified. Thanks to [@mistralol].
- Removes [colors][colors] in favor of [chalk][chalk].
- Updates dependencies and adds dependency badge.
- Adds linter, gulp for running tests.
- Adds tests, and moves to a more test-able architecture. Replaces [nomnom][nomnom] with [minimist][minimist], and adds a custom validator for CLI options.
- Adds additional fields: cc, bcc, replyTo. Allows multiple emails as a comma-separated list in fields where it's sensible.
- Adds preferGlobal to the package, to warn if installed locally.
- Adds flag to print version of cli and nodemailer.
- Cleans up command line switches, and adds support for attachments.
- Initial Release.
The MIT License (MIT)Copyright (c) 2014 Nathan Wittstock
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.