Issue with Outlook not threading emails (Better Send Mail, References/In-Reply-To) node : n8n-nodes-better-send-mail v0.1.2

Describe the problem/error/question

I’m trying to use Better Send Mail with custom headers (References and In-Reply-To) so replies stay in the same thread. It works in Gmail, but in Outlook (with CDMON as mail provider) the replies always create a new thread instead of staying in the original one.

What is the error message (if any)?

No error message. Emails are sent, but threading is broken in Outlook.

Please share your workflow

{
  "nodes": [
    {
      "parameters": {
        "fromEmail": "[email protected]",
        "toEmail": "={{ $('Code').item.json.fromAddress }}",
        "subject": "={{ $('Code').item.json.originalSubject }}",
        "emailFormat": "both",
        "text": "={{ $json.emailText }}",
        "html": "={{ $json.emailHtml }}",
        "options": {
          "appendAttribution": false,
          "attachments": "={{ Object.keys($binary).join(',') }}"
        },
        "customHeadersUi": {
          "headers": [
            {
              "name": "References",
              "value": "={{ $json.metadata.references ? $json.metadata.references + ' ' + $json.metadata['message-id'] : '' }}"
            },
            {
              "name": "In-Reply-To",
              "value": "={{ $json.metadata['message-id'] }}"
            }
          ]
        }
      },

Share the output returned by the last node

The email is accepted and delivered, but Outlook and IONOS web mail starts a new conversation thread.

Information on your n8n setup

  • Information on your n8n setup
    • n8n version: 1.107.4 (self-hosted)

    • Database: default (SQLite)

    • n8n EXECUTIONS_PROCESS: own

    • Running n8n via: Docker

    • Operating system: Ubuntu 20.04

Hey, a few things for you to try:

Add the Thread-Index header to your custom headers:

// In your Better Send Mail node, add this header: 
{   "name": "Thread-Index",   "value": "={{ $json.metadata['thread-index'] || '' }}" }

Outlook relies heavily on subject line prefixes:

// Ensure proper "Re:" prefix in subject
"subject": "={{ $('Code').item.json.originalSubject.startsWith('Re:') ? $('Code').

Your current References header might be malformed, always include the message ID:

// Current (potentially problematic):
 "value": "={{ $json.metadata.references ? $json.metadata.references + ' ' + $json.metadata['message-id'] : '' }}"

// Fixed format:
 "value": "={{ $json.metadata.references ? $json.metadata.references + ' ' + $json.metad

Hi ! Thanks.., but nothing works .

Alright, let’s send one email to both, with the new headers included. Then you need to get the RAW email from each place and paste it here: Email Header Analyzer, RFC822 Parser - MxToolbox

Goal is to see if they have the same headers. This will highlight if something is stripping them (could be CDMON).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.