Message-ID / References headers

Hidden message identifiers that let inboxes connect a reply to its parent and reconstruct the rest of the email conversation.

how gmail knows two emails are in the same conversationkeeping replies in one email threadthe hidden ids behind an email chainwhy did this reply start a new threadmessage id referancesmy support emails show up as separate messagesin reply to headermake my app replies stack like a chat

See it

Live demo coming soon

What it is

Message-ID gives one message a globally unique identifier. On a reply, In-Reply-To names the immediate parent and References carries the ordered chain of earlier Message-IDs. Mail clients use that family tree, often alongside the subject and participants, to group separate messages into one conversation view.

Set the headers when your app sends replies on behalf of users, powers a support thread, or bridges email into another messaging system. Preserve the received Message-ID exactly, including its angle-bracketed form, create one fresh Message-ID for every outgoing message, and append the parent lineage to References.

Threading is not a protocol guarantee. Gmail, Apple Mail, and Outlook apply their own heuristics, so correct headers make threading possible but cannot force identical grouping everywhere. A Message-ID is also neither secret nor authenticated: do not use it as an authorization token, and do not reuse one as a campaign-wide tracking ID or clients may deduplicate unrelated messages.

Ask AI for it

Add standards-based reply threading to this Nodemailer workflow. Store the exact RFC 5322 Message-ID from each received message, generate a new unique 'messageId' for every outgoing reply, set Nodemailer's 'inReplyTo' property to the immediate parent's ID, and set 'references' to the parent's existing References chain followed by that parent's Message-ID. Preserve angle brackets and ordering, never reuse a Message-ID across recipients, and keep authorization on our internal conversation ID rather than trusting a header supplied by email. Include a generated-message test that parses Message-ID, In-Reply-To, and References and proves a three-message chain remains intact.

You might have meant

subject linetransactional emailemail delivery event webhookscorrelation id

Go deeper