import nodemailer from "nodemailer"; const transporter = nodemailer.createTransport({ host: "localhost", port: 1025, secure: false, auth: { user: "postmaster", pass: "password", }, }); const info = await transporter.sendMail({ from: "foo ", to: "bar ", subject: "Hello world!", html: "Hello world.", }); console.log(info.messageId);