An open API service indexing awesome lists of open source software.

https://github.com/ishanmk/automatic-email-sender

Automatic Email Sender Using NodeJS
https://github.com/ishanmk/automatic-email-sender

automated automatic backend email es6 javascript js mail-notification mail-notifier mailsender nodejs nodemailer notifications scheduled-notifications scheduled-tasks

Last synced: over 1 year ago
JSON representation

Automatic Email Sender Using NodeJS

Awesome Lists containing this project

README

          

# Automatic-Email-Sender
Automatic Email Sender Using NodeJS
## Download the mailSender to your PC
### Installation
```sh
git clone https://github.com/IshanMK/Automatic-Email-Sender.git
```
### Install all the modules required
* Inside the directory where package.json is located run the following code from your terminal
```sh
npm install
```

## Configuration for your Gmail Account
* Go to your [Google Account](https://myaccount.google.com/)
* Then Go to Security Tab

![EcZhsd9Hlb](https://user-images.githubusercontent.com/73387606/176173930-2e813930-7479-48b3-aa8f-b55813aee4e8.png)
* Turn on 2-step verification

![mhlCdvSp1u](https://user-images.githubusercontent.com/73387606/176174594-98e6f5ed-8728-4d71-b482-ed02f5512fc9.png)
* After turning on 2-step verification go back now you will see new option below 2-step Verification.
* Go to the new Option App passwords

![EMRDrRzOMc](https://user-images.githubusercontent.com/73387606/176175682-b4857c5b-140f-4cc7-9243-5826a85a38e0.png)

* You will get the followings

![g0KEXurtTr](https://user-images.githubusercontent.com/73387606/176176082-eaf287ed-6d78-4cf1-a6c7-657db499eb3b.png)

* Click on select app and choose the option Other(Custom name)

![68Nseu72IZ](https://user-images.githubusercontent.com/73387606/176176387-e9038aaf-978f-4a81-9c7a-f628701b4967.png)

* Provide the custom name for your application and click on Generate

![iPm0D0Txr7](https://user-images.githubusercontent.com/73387606/176176845-61512052-d987-4d8c-bef2-968938d18dcf.png)

* It will automatically generate a password with 16 characters for your application

![ySjrEqW0lU](https://user-images.githubusercontent.com/73387606/176177376-2992db50-d38e-4f41-9d9e-d8fa309c8206.png)
* Copy the password to the clipboard

## Setting Up the .env.auth file
* If you have a smtp server use it other use smtp.gmail.com as the HOST.
* The PORT regarding the smtp is 587.use 587 as HOST_PORT.
* Use gmail as the SERVICE.
* Use your own email address as EMAIL_USERNAME.
* Use the password copied to the ciplboard as the PASSWORD


![1DcgISgMHz](https://user-images.githubusercontent.com/73387606/176180194-bcaa47b4-d2e9-4a5c-aa96-c04d84be76e3.png)

## Setting Up sendEmail.js
* Provide the recipients with an array of recipients mails seperated by commas as strings.If there is only single recipient no need an array of recipients.Just provide the single email as a string
* Just Provide the scheduledDate with the Date-Time_TimeZone you want to send the email
* eg : 2022-06-28T18:16:45+05:30
* Provide sender , subject and content as you want

![4Mwynv1nzD](https://user-images.githubusercontent.com/73387606/184113776-e9e4c1ca-ed2c-47a8-aacc-e878602c64a7.png)

## Start Sending Mails
* After doing all the above steps just run the following code from your terminal
```sh
node sendEmail
```
or
```sh
npm start
```

[Find More About moment module](https://momentjs.com/)