We can automatically send email with attachments via gmail api through nodemailer with an google login system.
Built an automatic email sender using gmail api with node.js(ejs) and nodemailer.
All the emails send will be from avineykhetarpal01@gmail.com
Download Node.js from the official site(like I did) or from here , and run the following at the terminal:
node index.js
To learn how to setup gmail api in node.js, check out the gmail_signin.
- copy/paste your configuration from your google cloud credentials into this file
- .env file
- index.js : Main project file, it has it initialize all the necessary files.
- router/router.js: It has it's logic to create endpoints for sending an email.
- router/login.js: It has it's logic to create endpoints for login.
- /views: It has different views for /login or /gmail/api route which is built using ejs.
- middleware.js : To check whether the user is loggin or not.
- static/home.css : Css files
- .env: All the necessary credentials
- Procfile: For heroku setup