Skip to content

Instantly share code, notes, and snippets.

@gmoqa
Last active April 25, 2019 23:12
Show Gist options
  • Save gmoqa/eeea81b6e290220ca062cf1350440200 to your computer and use it in GitHub Desktop.
Save gmoqa/eeea81b6e290220ca062cf1350440200 to your computer and use it in GitHub Desktop.
SMTP Tester
#!/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