The send(mail, callback) method sends an e-mail using the configured SMTP settings.
mail: A mail object containing the message and envelope information.callback: A function called with (err, info). If successful, info includes the envelope (from/to) and the messageId.
The method handles connection establishment, authentication (if auth is configured), and connection closure automatically.
transport.send(mail, (err, info) => {
if (err) {
return console.log('Error occurred:', err);
}
console.log('Message sent:', info.messageId);
console.log('Envelope:', info.envelope);
});