A sample application for sending emails using Nodemailer from Gmail using its SMTP server
- Create a .env file in the root directory with following the keys:
USER
: < yourEmailId >@gmail.comPASS
: password that you generate from Gmail App PasswordsPORT
: this is optional, if not provided app will run on port 3000
- Make sure you have enabled Two-Step Verification on your Gmail account.
- Simply run
npm start
and send a payload tohttp://localhost:<port_number>/sendemail
Payload -{ to: <receiverEmailId>@gmail.com, subject: "Your Email Subject" }