So i try to use javascript in html when i send email with nodemailer.But when i alert, JS does not working at all.Do i need to create another page in order to do that?
Thanks.
let testAccount = await nodemailer.createTestAccount();
let transporter = nodemailer.createTransport({
host: "smtp.ethereal.email",
port: 587,
secure: false,
auth: {
user:"**********", // generated ethereal user
pass:"**********", // generated ethereal password
},
});
// send mail with defined transport object
let info = await transporter.sendMail({
from: '"***************', // sender address
to: "***************", // list of receivers
subject: "Email Verification ✔", // Subject line
text: "Email Verification", // plain text body
html:" <h1>Verrification email</h1> <h2>Click the button so you can verify your account!</h2> <button id = 'button' type='button'>Verify!</button> <script> document.getElementById('button').onclick = function(){alert('Verified')} </script>"
});