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);
});
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);
});
Leave a Reply