Sending email from local host with Nodemailer
问题 I'd like to send mails on my local server but it seems not working with Nodemailer and NodeJS. Is there any solutions to send mails from local? var contact = {subject: 'test', message: "test message", email: 'visitor@gmail.com'}; var to = "myemail@gmail.com"; var transporter = nodemailer.createTransport(); transporter.sendMail({ from: contact.email, to: to, subject: contact.subject, text: contact.message }); 回答1: const transporter = nodemailer.createTransport({ port: 25, host: 'localhost',