# feathers-mail

> Feathers Mail Service and Hooks

Latest version **1.0.2** (published 2020-10-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install feathers-mail
pnpm add feathers-mail
yarn add feathers-mail
bun add feathers-mail
```

## 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.2 |
| Published | 2020-10-25 |
| First published | 2020-10-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 (+22 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | AAM Services |
| Maintainers | aaronm |
| Keywords | feathers, feathersjs, feathers-plugin, mail, email, nodemailer |

## Links

- npm: https://www.npmjs.com/package/feathers-mail
- Repository: https://github.com/aam-git/feathers-mail
- Homepage: https://github.com/aam-git/feathers-mail#readme
- Issues: https://github.com/aam-git/feathers-mail/issues
- npm.io page: https://npm.io/package/feathers-mail

## Dependencies (3)

- [validator](https://npm.io/package/validator.md) ^13.1.17
- [nodemailer](https://npm.io/package/nodemailer.md) ^6.4.14
- [feathers-hooks-common](https://npm.io/package/feathers-hooks-common.md) ^5.0.4

## 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.2 (latest) — 2020-10-25
- 1.0.1 — 2020-10-25
- 1.0.0 — 2020-10-25

## README

# feathers-mail

> Simple Feathers mailer service using [`nodemailer`](https://github.com/nodemailer/nodemailer)
>
>For security, the Mail service has been set up to only work internally.  The service is named _mailer

## Installation

```shell
npm install feathers-mail --save
```

## How to use

#### In your config file (eg config/default.json) add
```js
  "feathers-mail": {
    "from": "your@email.here",
    "smtp": {
        "host": "smtp.host.here",
        "secure": true,
        "auth": {
          "user": "smtp@user.here",
          "pass": "replacewithpassword"
        }
    }
  }
```
More smtp settings available here [`https://nodemailer.com/smtp/`](https://nodemailer.com/smtp/)


####Install plugin
```js
// mailer plugin
app.configure(require('feathers-mail'));
```
This can be done in either
* app.js after "app.configure(channels);"
* in any class or service where app. is available.

if you define the service multiple times, it will ignore the duplicates


#### Example usage

```js
    try {
        await app.service('_mailer').create({
                from: "sender@server.com",
                to: "receiver@sender.com",
                subject: "Message title",
                text: "Plaintext version of the message",
                html: "<p>HTML version of the message</p>"
        });
    } catch (error) {
  
      //do something with error    

    }
```

Node Mailer message settings [`https://nodemailer.com/message/`](https://nodemailer.com/message/)

## License

Copyright (c) 2020

Licensed under the [MIT license](LICENSE).

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