Automatic Email Sender Using NodeJS
git clone https://github.com/IshanMK/Automatic-Email-Sender.git
- Inside the directory where
package.json
is located run the following code from your terminal
npm install
-
Go to your Google Account
-
Then Go to
Security
Tab -
Turn on
2-step verification
-
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
-
You will get the followings
-
Click on
select app
and choose the optionOther(Custom name)
-
Provide the custom name for your application and click on
Generate
-
It will automatically generate a password with
16
characters for your application -
Copy the password to the
clipboard
- If you have a smtp server use it other use
smtp.gmail.com
as theHOST
. - The
PORT
regarding thesmtp
is587
.use587
asHOST_PORT
. - Use
gmail
as theSERVICE
. - Use your own email address as
EMAIL_USERNAME
. - Use the
password copied to the ciplboard as the PASSWORD
- 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 theDate-Time_TimeZone
you want to send the email - eg :
2022-06-28T18:16:45+05:30
- Provide
sender
,subject
andcontent
as you want
- After doing all the above steps just run the following code from your terminal
node sendEmail
or
npm start