# strapi-provider-email-smtp2

> Strapi SMTP email provider with nodemailer

Latest version **0.2.0** (published 2021-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install strapi-provider-email-smtp2
pnpm add strapi-provider-email-smtp2
yarn add strapi-provider-email-smtp2
bun add strapi-provider-email-smtp2
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2021-01-26 |
| First published | 2021-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.1 KB |
| Known vulnerabilities | 0 (+15 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | PatternDigital |
| Maintainers | patterndev |
| Keywords | strapi, email, provider, smtp, nodemailer |

## Links

- npm: https://www.npmjs.com/package/strapi-provider-email-smtp2
- Repository: https://github.com/patterndigital/strapi-provider-email-smtp2
- Homepage: https://github.com/patterndigital/strapi-provider-email-smtp2#readme
- Issues: https://github.com/patterndigital/strapi-provider-email-smtp2/issues
- npm.io page: https://npm.io/package/strapi-provider-email-smtp2

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [nodemailer](https://npm.io/package/nodemailer.md) ^6.4.6

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

- 0.2.0 (latest) — 2021-01-26
- 0.1.0 — 2021-01-20

## README

# strapi-provider-email-smtp2
A third-party SMTP email provider for Strapi.

## Installation
In the root directory of your project, run:

```bash
npm i strapi-provider-email-smtp2
```

## Configuration
In your `config/plugins.js`, set the following:

```javascript
module.exports = ({ env }) => ({
  email: {
    provider: 'smtp2',
    providerOptions: {
      host: 'smtp.gmail.com', //SMTP Host
      port: 465   , //SMTP Port
      secure: true,
      username: 'my.username@gmail.com',
      password: 'my.password',
      rejectUnauthorized: true,
      requireTLS: true,
      connectionTimeout: 1,
    },
    settings: {
      from: 'my.username@gmail.com',
      replyTo: 'my.username@gmail.com',
    },
  },
});
```

Don't forget to allow 'Less Secure Apps' from account security options, if sending via Gmail.


## Usage

Send mail 
```javascript
	  let options={
            to: 'some_user@example.com',
            from: 'admin@mysite.com',
            subject:  "Test message",
            text:  "Test",
            html:  "<div>Test</div>"
          };
          await strapi.plugins['email'].services.email.send(options);
```

Reconfigure provider
```javascript
    let newProviderOptions= {
      host: 'smtp.gmail.com', //SMTP Host
      port: 465   , //SMTP Port
      secure: true,
      username: 'my.username@gmail.com',
      password: 'my.password',
      rejectUnauthorized: true,
      requireTLS: true,
      connectionTimeout: 1,
    };
    await strapi.plugins.email.provider.reinit(newProviderOptions);
```

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