Created
October 26, 2018 19:56
-
-
Save adamlacombe/04fbbefc202fd2725448b476a9f94039 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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