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?