Always handle errors gracefully:
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.error('Error sending email:', error);
}
console.log('Email sent successfully:', info.response);
});
Handling Errors
My WordPress Blog
My WordPress Blog
Always handle errors gracefully:
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.error('Error sending email:', error);
}
console.log('Email sent successfully:', info.response);
});