What is Nodemailer
Nodemailer is a Node.JS npm module for sending emails. This has been the go to solution to most NodeJS developers for email delivery in their applications.
How to use Nodemailer
Execute the following command in the Node.js command prompt:
1 | npm install nodemailer |
or
1 | yarn add nodemailer |
Example
In this example, I am using Mailgun to send emails. You can sign up and get the STMP information required.
1 | ; |
If you have your own custom domains, Zoho Mail provides a free plan with custom domain support, it supports SMTP protocol as well.
Nodemailer for Strapi
Strapi is an open-source headless CMS. There is a Nodemailer plugin you can use in your project.
In your console, excute the following command to install it:
1 | # using yarn |
Then edit the file config/plugins.js
in your Strapi project:
1 | module.exports = ({ env }) => ({ |
After that you will be able to view your Email configuration and test email delivery at the Strapi Dashboard: