Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

152
Views
Nodemailer is sending emails with the same subject as thread

Nodemailer is sending emails as a thread if the email has the same subject as a previously sent email. But I want to send the emails as separate emails, even if they have the same subject as each other.

I have an application that sends notification emails to users. The emails all have the same subject: notification. This is causing the emails to show as a thread, at least in Gmail:

enter image description here

How can I make each notification email send separately?

const nodemailer = require('nodemailer');

const logger = require('./logger');

class Email {
  constructor(email, to, pass) {
    this.user = email;
    this.to = to;
    this.pass = pass;
  }

  get mailOptions() {
    return {
      from: this.user,
      to: this.to,
      subject: 'notification',
      html: 'You received a new purchase in your shop.',
    };
  }

  get transporter() {
    const transporter = nodemailer.createTransport({
// for zoho emails
      host: 'smtp.zoho.com',
      port: 587,
      secure: false,
      auth: {
        user: this.user,
        pass: this.pass,
      },
    });

    return transporter;
  }

  send(cb) {
    this.transporter.sendMail(
      this.mailOptions,
      cb ||
        ((error, info) => {
          if (error) console.log(error);
          if (info) logger.log('silly', `message sent: ${info.messageId}`);
          this.transporter.close();
        })
    );
  }

  sendSync() {
    return new Promise((res, rej) =>
      this.transporter.sendMail(this.mailOptions, (error, info) => {
        if (error) rej(error);
        else res(info);
        this.transporter.close();
      })
    );
  }
}

const email = new Email(
  'somesendingemail@gmail.com',
  'somereceivingemail@gmail.com',
  'SendINgEmAIlPassWoRD'
);

email.send();
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!