Send email with Nodemailer over SMTP

Nodemailer is not deprecated. Create a transport with createTransport, point it at smtp.unitpost.com on port 587 (STARTTLS) or 465 (implicit TLS), and send from a verified domain. Port 25 is blocked on most clouds — don't use it. The same transport works in Express, Next.js, and NestJS.

What are the SMTP settings?

Hostsmtp.unitpost.com
Usernameunitpost(always this literal value)
PasswordYour Unitpost API key(must carry emails:send)
Port (STARTTLS)587(or 2587 if blocked)
Port (implicit TLS)465(or 2465 if blocked)
From addressAny address on a verified domain

How do I set it up?

  1. Install Nodemailer

    Add it to your Node.js project (Node 18+). The package is actively maintained.

    Shell
    npm install nodemailer
  2. Create a transport

    Point createTransport at smtp.unitpost.com. Use port 587 with secure: false for STARTTLS, or port 465 with secure: true for implicit TLS. The username is always unitpost; the password is your API key with emails:send.

    JavaScript
    import nodemailer from "nodemailer";
    
    const transporter = nodemailer.createTransport({
      host: "smtp.unitpost.com",
      port: 587,
      secure: false,
      requireTLS: true,
      auth: {
        user: "unitpost",
        pass: process.env.UNITPOST_API_KEY,
      },
    });

    Port 25 vs 587: 25 is the legacy submission port and is blocked by AWS, GCP, and most VPS providers. 587 with STARTTLS is what you want. 465 is implicit TLS if 587 is filtered.

  3. Send an email

    The from address must be on a domain you've verified in Unitpost. This is the same sendMail call in a Next.js Route Handler or a NestJS provider.

    JavaScript
    await transporter.sendMail({
      from: "you@yourdomain.com",
      to: "customer@example.com",
      subject: "Hello from Unitpost",
      html: "<h1>Welcome!</h1><p>Sent via SMTP.</p>",
    });
  4. Verify it in the dashboard

    Open Activity in your Unitpost dashboard — the message appears alongside API sends, with delivery, open, and click status. Framework-specific walkthroughs: Next.js, NestJS, Express.