import nodemailer from "nodemailer";
const yourEmail = "yourEmail@gmail.com";
const yourPass = "yourEmailPasswrd";
const mailHost = "smpt.gmail.com";
const mailPort = 587;
const senderEmail = "senderEmail@gmail.com"
const sendMail = (to, subject, htmlContent) => {
let transporter = nodemailer.createTransport({
host: mailHost,
port: mailPort,
secure: false,
auth: {
user: yourEmail,
pass: yourPass,
},
});
let mailOptions = {
from: senderEmail,
to: to,
subject: subject,
html: htmlContent,
};
return transporter.sendMail(mailOptions);
};
export default sendMail;