In Node.js, we can pick and choose from a lot of modules that make sending email easier. One of the most commonly used modules is “nodemailer.” Check out the sample code to see how quickly you can send an email using the nodemailer module.
var nodemailer= require('nodemailer');//create the transported object with the email id and passwordvar transporter = nodemailer.createTransport({service: 'Gmail',??auth: { user: ???emailaddress???, pass: ???password '??}});//prepare the mail objectvar mailContent = {??from: ???senderEmailAddress???,??to: ???recepeintEmailAddress???,??subject: ???emailSubject???,??text: ???emailBody???};//Send mail with the mail detailstransporter.sendMail( mailContent, function(error, info){ if(error) { console.log(error); } else { console.log(info); }});