0

Am using nodemailer to send mails. But reply functionality is not working as expected. below is the mailOptions am using during reply operation. Mail is received but not shown in a same thread

new MailComposer({
      from: fromEmail,
      to: toAddress,
      inReplyTo: <some unique string here @mail.gmail.com>(it is a messageId from the mail am replying to),
      references: <some unique string here @mail.gmail.com>(same as inReplyTo),
      subject(same as the message am replying to),
      html,
      headers: {
        replyTo: toAddress,
        'In-Reply-To': <some unique string here @mail.gmail.com>(same as inReplyTo),
        references: <some unique string here @mail.gmail.com>(same as inReplyTo) 
      },
    });
...
api.send({
    userId: 'me',
    auth,
    requestBody: {
      raw: encodedMessage
      threadId: 'threadId from the message am replying to'
    }
  });

What am i missing or doing wrong?

Logesh R
  • 13
  • 3

1 Answers1

0

Ensure that in the mailOptionConfig that the subject of the mail you are replying to have the same subject. If you change the subject, then a new thread will be created.

Sunday Aroh
  • 21
  • 1
  • 4