# nodemailer-bash

> A CLI for sending e-mail with nodemailer.

Latest version **1.0.1** (published 2020-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install nodemailer-bash
pnpm add nodemailer-bash
yarn add nodemailer-bash
bun add nodemailer-bash
```

Provides the command `nodemailer`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-09-09 |
| First published | 2020-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 (+15 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Gabriel Romualdo Pôrto |
| Maintainers | portogabriel |
| Keywords | cli, nodemailer, mail, node |

## Links

- npm: https://www.npmjs.com/package/nodemailer-bash
- Repository: https://github.com/p0rto/nodemailer-bash
- Homepage: https://github.com/p0rto/nodemailer-bash#readme
- Issues: https://github.com/p0rto/nodemailer-bash/issues
- npm.io page: https://npm.io/package/nodemailer-bash

## Dependencies (4)

- [esm](https://npm.io/package/esm.md) ^3.2.25
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [commander](https://npm.io/package/commander.md) ^6.1.0
- [nodemailer](https://npm.io/package/nodemailer.md) ^6.4.11

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2020-09-09
- 1.0.0 — 2020-09-09

## README

# nodemailer-bash

A basic command line interface for sending emails with [Nodemailer](https://nodemailer.com/).

[![npm version](https://img.shields.io/npm/v/nodemailer-bash)](https://www.npmjs.com/package/nodemailer-bash)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Installation

    npm install -g nodemailer-bash
    
## Getting started

#### Usage

    nodemailer <from> <to> [options]

#### Options

Alias | Option | Description | Default 
---- | ---- | ---- | ----
-V | --version | Output the version number of nodemailer-cli and nodemailer. | 
-h | --host | The SMTP host. | env.MAIL_SMTP
-r | --port | The port to use when contacting the SMTP server. | 587
-s | --secure |  True for 465, false for other ports. | false
-u | --user | The SMTP username to use when authenticating. | env.MAIL_USER
-p | --pass | The plain-text password to use when authenticating. | env.MAIL_PASSWORD
-j | --subject | The string to be used as the emails subject. | 
-t | --text | The plaintext message body. |
-m | --html | The html version of text message body. |
no alias | --attachments <name, file...> | Add attachment. | 
no alias | --help | Display help for command. | 

#### Adding attachment
For sending attachments with your email, use ``--attachments <filename, filepath>``. You need to pass a filename with the file extension, like this:

    --attachments name.jpg C:\file.jpg name2.pdf C:\file2.pdf
    
#### Sending email to multiple contacts
If you want to send an email to more than one contact, use ``nodemailer <send@test.com> <receiver1@test.com> <receiver2@test.com> <receiver3@test.com> ...``. The first email address should be the sender, and all the others will be the receivers.

    nodemailer send@test.com receiver1@test.com receiver2@test.com -t "Hello Everyone!"
    
#### Custom sender name
To customize your name when sending an email, use ``nodemailer "Name Foo<send@test.com>"``.

## .ENV Variables
To use the enviroment variables, you must create a ``.env`` file in your project with the content below:

- **MAIL_USER**: The username to use when authenticating.
- **MAIL_PASSWORD**: The password to use when authenticating.
- **MAIL_SMTP**: The hostname of the SMTP server to be used.

## License

[MIT](https://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/nodemailer-bash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
