MrGussio / strapi-provider-email-smtp

A third-party SMTP email provider for Strapi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

strapi-provider-email-smtp

A third-party SMTP email provider for Strapi, tested with Gmail SMTP.

Installation

In the root directory of your project, run:

npm i strapi-provider-email-smtp

Configuration

In your config/plugins.js, set the following:

Strapi v4:

module.exports = ({ env }) => ({
  email: {
    config: {
      provider: 'strapi-provider-email-smtp',
      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,
	useAuth: true,
      },
    },
    settings: {
      from: 'my.username@gmail.com',
      replyTo: 'my.username@gmail.com',
    }, 
  },    
});

Strapi v3:

module.exports = ({ env }) => ({
  email: {
    provider: 'smtp',
    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,
      useAuth: true,
    },
    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.

About

A third-party SMTP email provider for Strapi

License:MIT License


Languages

Language:JavaScript 100.0%