# imago-sendemail

> A simple utility to send email using the Amazon SES.

Latest version **2.1.0** (published 2019-02-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install imago-sendemail
pnpm add imago-sendemail
yarn add imago-sendemail
bun add imago-sendemail
```

## 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 | 2.1.0 |
| Published | 2019-02-13 |
| First published | 2018-01-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 163 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Imago.ai |
| Maintainers | imago.ai |
| Keywords | imago.ai, imago, email, aws, ses |

## Links

- npm: https://www.npmjs.com/package/imago-sendemail
- npm.io page: https://npm.io/package/imago-sendemail

## Dependencies (2)

- [dotenv](https://npm.io/package/dotenv.md) ^6.2.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.401.0

## 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

- 2.1.0 (latest) — 2019-02-13
- 2.0.1 — 2018-08-24
- 2.0.0 — 2018-08-01
- 1.0.1 — 2018-01-10
- 1.0.0 — 2018-01-10

## README

# Imago Send Email #

A simple utility for sending emails via the Amazon SES.

To use it, you need to first sign up for AWS and Simple Email Service there, set up a domain, and generate credentials (not SMTP credentials - the other type of credentials, that include access key ID and secret access key). More details: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/using-credentials.html

## Setting up variables ##

1. Set environment variable `AWS_REGION` (e.g. to `us-east-1`). 
2. Set environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` to your Amazon credentials created using IAM.
3. Set environment variable SENDER_EMAIL_ADDRESS to your Amazon-approved email address. This will show in the From field of all emails.

## Setting up code ##

Install this package: 

```
npm i --save imago-sendemail
```

Run the code with these options:

```js
const Sender = require('imago-sendemail');

let sender = new Sender({
  to: 'example@example.com',
  cc: 'someone.else@example.com', // optional
  bcc: 'secret@example.com', // optional
  subject: 'Hey there',
  body: {
    html: '<h1>HTML text of your email</h1>',
    text: 'Plaintext of your email',
  },
});

await sender.send();
```

It is better to wrap the `.send()` in a try-catch because it will throw an
exception in case of any error.

There are no other options except as shown above.

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