Skip to content

Instantly share code, notes, and snippets.

@wobsoriano
Last active August 17, 2019 13:18
Show Gist options
  • Save wobsoriano/a4ac291ed8599ec6c7bc0bbd872d4e8b to your computer and use it in GitHub Desktop.
Save wobsoriano/a4ac291ed8599ec6c7bc0bbd872d4e8b to your computer and use it in GitHub Desktop.
Send email using Nodemailer with Axigen credentials

Send email using Nodemailer with Axigen credentials

1. Install nodemailer package

npm install nodemailer --save

2. Copy example

const nodemailer = require("nodemailer");

async function run() {
  let transporter = nodemailer.createTransport({
    host: 10.10.120.68,
    port: 25,
    secure: false,
    auth: {
      user: [email protected] // email generated by admin
      pass: password // password generated by admin
    },
    tls: {
      rejectUnauthorized: false
    }
  });

  let info = await transporter.sendMail({
      from: '"Fred Foo 👻" <[email protected]>', // sender address
      to: "[email protected], [email protected]", // list of receivers
      subject: "Hello ✔", // Subject line
      text: "Hello world?", // plain text body
      html: "<b>Hello world?</b>" // html body
  });

  console.log("Message sent: %s", info.messageId);
  // Message sent: <[email protected]>
}

run().catch(console.error);

Reference

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment