Prolateral Consulting Ltd
Prolateral Consulting Ltd
Support
Support
Knowledgebase Articles
Help
Setup examples
Support

Prolateral offers primary and backup domain (DNS) services, with servers in key geographic locations providing the best service possible.

Problem

How do I set up outbound SMTP using Nodemailer for Node.js?
How do I use outMail with Nodemailer?

Solution

In this article we discuss using outMail as the outbound email server with Nodemailer for Node.js.  We assume already you have a working development environment with node.js installed and you are looking at just configuring the SMTP Server settings to use outMail for the nodemailer library.

Installing nodemailer

npm install nodemailer

Using nodemailer to send an email with outMail.

The below example demonstrates how to send an email with plain text and HTML body


"use strict";
const nodemailer = require("nodemailer");

async function main() {
  // create transporter object using the default SMTP transport
  let transporter = nodemailer.createTransport({
    host: "mxXXXXX.smtp-engine.com",
    port: 587,
    secure: false, // This example has TLS off
    auth: {
      user: "outMail-username",
      pass: "outMail-password",
    },
  });

  // send mail with defined transport object
  let info = await transporter.sendMail({
    from: '"My Name" <me@example.com>', 
    to: "toAddress@example.com", 
    subject: "Subject goes here...",
    text: "Hello world",
    html: "Hello world",
  });

  console.log("Message sent: %s", info.messageId);
}

main().catch(console.error);

 

Summary of server details

Outgoing server

mxXXXXXX.smtp-engine.com

As provided in your signup email.

Outgoing server protocol

SMTP

Outgoing server port

25, 465, 587, 2525 or 8025

Authentication Type

Basic Authentication, SSL and TLS supported

Username

As provided

Password

As provided

 

like it, love it, then share it. Share this article on social media.

Did you enjoy this article?

Disclaimer

The Origin of this information may be internal or external to Prolateral Consulting Ltd. Prolateral makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Prolateral makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.