const nodemailer = require("nodemailer");
let email = ""
let send_to = ""
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host: "smtp.gmail.com",
port: 587,
secure: false, // true for 465, false for other ports
auth: {
user: "", // generated ethereal user
pass: "", // generated ethereal password
},
});
var mailOptions = {
from: email,
to: send_to,
subject: 'Sending Email using Node.js',
text: '<h1>TEST DESH!!</h1>'
};
transporter.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {
console.log('Email sent: ' + info.response);
}
});