Last active
April 25, 2019 23:12
-
-
Save gmoqa/eeea81b6e290220ca062cf1350440200 to your computer and use it in GitHub Desktop.
SMTP Tester
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
#!/usr/bin/env node | |
const mailer = require('nodemailer'); | |
async function main(){ | |
let transporter = mailer.createTransport({ | |
host: "host", | |
port: '25', | |
secure: false, | |
auth: { | |
user: 'user', | |
pass: 'pass' | |
} | |
}); | |
let info = await transporter.sendMail({ | |
from: '"John Doe" <jhon@doe.cl>', | |
to: "mail@example.com", | |
subject: "Hello ✔", | |
text: "Hello world?", | |
html: "<b>Hello world?</b>" | |
}); | |
console.log("Message sent: %s", info.messageId); | |
} | |
main().catch(console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment