Skip to content

IshanMK/Automatic-Email-Sender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Automatic-Email-Sender

Automatic Email Sender Using NodeJS

Download the mailSender to your PC

Installation

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
npm install

Configuration for your Gmail Account

  • Go to your Google Account

  • Then Go to Security Tab

    EcZhsd9Hlb

  • Turn on 2-step verification

    mhlCdvSp1u

  • 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

  • You will get the followings

    g0KEXurtTr

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

    68Nseu72IZ

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

    iPm0D0Txr7

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

    ySjrEqW0lU

  • 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

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

Start Sending Mails

  • After doing all the above steps just run the following code from your terminal
node sendEmail

or

npm start

Find More About moment module