const nodemailer = require("nodemailer"); require("dotenv").config(); const sendEmail = async (fullname, email, otp) => { const transporter = nodemailer.createTransport({ service: "gmail", auth: { user: process.env.EMAIL, pass: process.env.PASSWORD, }, }); const info = await transporter.sendMail({ from: process.env.EMAIL, to: email, subject: "Your Verification OTP", html: `

Hello ${fullname},

Your OTP for password reset is:

${otp}

This OTP is valid for 10 minutes.

` }); return info; }; module.exports = sendEmail;