Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import * as nodemailer from 'nodemailer';
let transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
user: '',
pass: '',
},
logger: false,
debug: false
}, {
from: `Someone <someone@test.com>`
});
let info = await transporter.sendMail({
// Comma separated list of recipients
to: `someone <someone@test.com>`,
// Subject of the message
subject: '',
// HTML body
html: 'body here'
});
console.log(nodemailer.getTestMessageUrl(info));
// only needed when using pooled connections
transporter.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment