This repository contains a template for using Nodemailer, a module for Node.js applications that allows you to send emails easily.
To use this project, follow these steps:
- Clone the repository to your local machine.
- Install the required dependencies using
npm install
. - Create a
.env
file in the root directory of the project. - Populate the
.env
file with the following configuration:
PORT=8080
EMAIL_USER='your-email'
EMAIL_PASSWORD='your-password'
EMAIL_SERVICE='your-service'
EMAIL_HOST='your-host'
EMAIL_PORT=587
You can find the appropriate values for EMAIL_SERVICE
and EMAIL_HOST
in the Nodemailer documentation.
- Customize the email templates and configurations according to your requirements.
- Run the application using
npm run dev
.
Feel free to contribute to this project by submitting pull requests or reporting issues.
- Go to your Google account at https://myaccount.google.com/
- Go to Security
- Choose 2-Step Verification - here you have to verify yourself, in my case it was with phone number and a confirmation code send as text message. After that you will be able to enabled 2-Step Verification
- Visit https://myaccount.google.com/apppasswords to create your app.
- Put a name e.g. nodemailer to your app and create it.
- A modal dialog will appear with the password. Get that password and use it in your code.
This project is licensed under the MIT License.