How to Send Transactional Email from Node.js with Phluit

How to Send Transactional Email from Node.js with Phluit

Why Use Phluit Email Sending for Transactional Email

Transactional email is mail your app sends automatically when a user takes an action. Examples include password resets, sign-in codes, receipts and invoices, order and shipping updates, and account notices. Unlike marketing newsletters, these messages are expected. The recipient asked for them, and they usually need to arrive within seconds.

Transactional email benefits from a dedicated service, not a shared mailbox or server. Why a dedicated service matters:

  • Faster delivery for time-sensitive messages like password resets and sign-in codes
  • Better deliverability through proper domain authentication
  • Easier maintenance with automatic bounce handling and logging

When your app sends a password reset, that email has to land in the inbox fast. If it lands in spam, the user can't log in, and you get a support ticket.

Phluit Email Sending lets your website or app send its own transactional email from your verified domain, through Phluit's mail servers. Your app connects over SMTP or the API, and it works with Node.js through nodemailer, a widely used email library for JavaScript.

What counts as transactional email

Phluit Email Sending allows password resets, sign-in codes, receipts and invoices, order and shipping updates, and account notices the recipient set up. That's it. No newsletters, no promotions, no cold email, no bought lists. The service is strictly transactional, which keeps deliverability high for the messages that matter.

Benefits of a dedicated sending service

A dedicated transactional email service gives you three things. First, your domain is verified with SPF, DKIM, and DMARC, so receiving servers know the mail is really from you. Second, bounces are handled automatically and hard bounces go on a do-not-send list. Third, you get an activity log that shows every message and its status. You know what was sent, what bounced, and what got held.

Before You Start: Requirements

Before you can send transactional email from Node.js, you need three things:

  1. An active hosting or app service at Phluit and at least one paid invoice. A domain alone doesn't qualify.
  2. A reviewed account. Every new account is reviewed before it can send, usually within one working day. You can add and verify domains and create keys while you wait.
  3. A domain to send from. A subdomain like mail.your-domain.com is recommended, and you need access to its DNS settings.

Step 1: Add and Verify Your Sending Domain

In the Phluit portal, go to Email → Email Sending → Domains tab. Add your domain, and you'll see four DNS records to create:

  • SPF (TXT record) declares which servers are allowed to send mail for your domain.
  • DKIM (TXT record) signs your messages with your key. This one is required.
  • Return path (CNAME record) receives bounces.
  • DMARC (TXT record) tells receiving servers what to do with mail that fails SPF or DKIM.

Create these records at your DNS provider, then click Check DNS. Your domain can send as soon as the DKIM record is found. You don't need to wait for all four to propagate. The full walkthrough is in Phluit Docs.

DNS records explained

SPF and DKIM are the two that matter most for deliverability. SPF says which servers are allowed to send for your domain. DKIM adds a digital signature that proves the mail wasn't tampered with. DMARC ties them together and is recommended for long-term deliverability. The return path CNAME makes sure bounces come back to Phluit's system so they're handled automatically.

Step 2: Create an SMTP Key

On the Keys tab, create an SMTP key. This is your password for the SMTP server. The key is shown only once, so copy it and store it securely. You'll also see your SMTP username under How to send on the Overview tab. That username is not your email address; it's a special string Phluit generates for your account.

Keep the key in a password manager or in your deployment secrets. You'll need it in the next step.

Step 3: Send Transactional Email from Node.js with Nodemailer

Nodemailer is a widely used Node.js library for sending emails. The Nodemailer documentation describes it as a module that makes sending email easy, and it works with Phluit's SMTP server.

First, install it in your project:

npm install nodemailer

Then set up a transporter. The SMTP server is postal20.phluit.net, port 587, with STARTTLS. Your username and SMTP key go in the auth object.

const nodemailer = require('nodemailer');

const transporter = nodemailer.createTransport({
  host: 'postal20.phluit.net',
  port: 587,
  secure: false, // STARTTLS
  auth: {
    user: process.env.SMTP_USERNAME,
    pass: process.env.SMTP_KEY
  }
});

Code example: sending a password reset email

Here's a function that sends a password reset email. It's triggered when a user clicks "Forgot password" on your site.

async function sendPasswordReset(toEmail, resetToken) {
  const resetLink = `https://yourapp.com/reset?token=${resetToken}`;

  const message = {
    from: 'noreply@mail.your-domain.com',
    to: toEmail,
    subject: 'Reset your password',
    html: `
      <p>Hello,</p>
      <p>We received a request to reset your password.</p>
      <p><a href="${resetLink}">Click here to reset it</a></p>
      <p>If you didn't request this, you can ignore this email.</p>
    `
  };

  try {
    const info = await transporter.sendMail(message);
    console.log('Password reset email sent:', info.messageId);
    return { success: true };
  } catch (error) {
    console.error('Failed to send password reset:', error);
    return { success: false, error };
  }
}

Call it from your route handler:

app.post('/forgot-password', async (req, res) => {
  const { email } = req.body;
  const token = generateResetToken();
  await sendPasswordReset(email, token);
  res.json({ message: 'If that email exists, a reset link is on its way.' });
});

Using environment variables for credentials

Never hardcode your SMTP username and key in your source code. Use environment variables instead. Create a .env file locally:

SMTP_USERNAME=your-username-here
SMTP_KEY=your-smtp-key-here

Then load it with dotenv:

npm install dotenv
require('dotenv').config();

On your production server, set the same environment variables in your deployment settings. That way your credentials never end up in a repository.

Step 4: Monitor Deliverability and Bounces

After you send, check the activity log in the Phluit portal. It shows every message with the time, recipient, subject, and status: sent, held, or bounced. You can search by recipient address, which helps when a user says they never got a password reset.

Phluit handles bounces automatically. Addresses that bounce for good are added to a do-not-send list, so you don't waste sends on dead addresses. If an address starts working again, you can remove it from the list in the portal.

What to do if an email isn't delivered

First, check the activity log. If the message shows as sent, the problem is on the receiving side. Ask the user to check spam and to add your sending address to their contacts. If the message shows as bounced, check the bounce reason.

Sending gets paused automatically for review when more than 5% of messages bounce in 24 hours (after at least 50 sent), when several messages are flagged as spam in a day, or when newsletter-style mail goes to many recipients. If that happens, the portal tells you the reason. Open a ticket to have sending switched back on.

For more on delivery issues, see the Phluit Docs article on undelivered email.

Next Steps: Scale Your App on Phluit

Once your transactional email is working, think about the rest of your infrastructure. Deploy your Node.js app on AirLift app hosting so it runs in the same ecosystem. That keeps everything in one portal.

For your app's data, use managed PostgreSQL and MySQL. You get a database without running your own server, with backups handled for you.

And if you'd rather focus on building features than on updates and monitoring, consider Phluit Care. The team handles updates, watches your app around the clock, and sends a monthly report.

Frequently asked questions

What is transactional email?

Transactional email includes password resets, sign-in codes, receipts, invoices, order and shipping updates, and account alerts. It's triggered by a user action, not marketing.

Can I send transactional email from Node.js with Phluit?

Yes, Phluit Email Sending works with Node.js via SMTP using nodemailer, or via the HTTP API. You need an active hosting or app service and a verified sending domain.

What SMTP server and port does Phluit Email Sending use?

The SMTP server is postal20.phluit.net, port 587 (or 25) with STARTTLS. Your username is shown in the portal under How to send, and the password is your SMTP key.

How do I verify my sending domain for Phluit Email Sending?

Add the domain in the Email Sending Domains tab, create the SPF, DKIM, return path, and DMARC DNS records, then click Check DNS. The domain can send once DKIM is found.

What happens if my email bounces or sending gets paused?

Hard bounces are added to a do-not-send list automatically. If more than 5% bounce in 24 hours or spam flags occur, sending is paused for review. Open a ticket to resume.


Setting up transactional email from Node.js takes about fifteen minutes. Here's the short version:

  1. Verify your domain
  2. Create an SMTP key
  3. Install nodemailer
  4. Send a test email

The activity log and automatic bounce handling mean you don't have to babysit it. Your password resets and receipts go out fast, from your own domain, through Phluit's mail servers. Pricing details and plan options are documented in Phluit Docs.

Get started with Phluit Email Sending today.

Related Articles

DNS Propagation: How Long It Takes and How to Check It Email & Domains

DNS Propagation: How Long It Takes and How to Check It

What DNS propagation really is, why a change can take minutes or two days, how to check it and how to plan a move without downtime.

Updated Dec 1, 2026
How to Move Your Email to Another Provider Email & Domains

How to Move Your Email to Another Provider

How to change email provider without losing messages: keep your address, copy old mail, change the MX records and set up your devices.

Updated Dec 1, 2026