Skip to content

Instantly share code, notes, and snippets.

@adamlacombe
Created October 26, 2018 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamlacombe/04fbbefc202fd2725448b476a9f94039 to your computer and use it in GitHub Desktop.
Save adamlacombe/04fbbefc202fd2725448b476a9f94039 to your computer and use it in GitHub Desktop.
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