37

My website sends emails to me with the same subject and they are being grouped into conversations even if I delete old ones (Mail, Gmail). I know I can change the subject to prevent this, but is there a header or something else that can be added to do this without forcing unique subject lines?

Louis W
  • 3,166
  • 6
  • 46
  • 76
  • gmail grouping infuriates me. Maybe I am too old school and like to read oldest to newest. I don't get gmail grouping. – ojblass May 02 '14 at 17:55
  • 3
    ojblass, it can be turned off in your preferences. But I need something that works from the sending side. – Louis W May 02 '14 at 18:27

2 Answers2

51

On the top of my head, there are two methods to avoid threading:

  • set the SMTP header X-Entity-Ref-ID with any value. This is what Google+ notifications do.
  • change the sender email (you can use From: info+randomstring@example.com). This is what Facebook notifications do.

The threading will be made if you force it with Reference or Reply-To.

rds
  • 26,253
  • 19
  • 107
  • 134
  • YES! Wow, this is saving me a ton of hair-pulling. All the other answers I found to this question were adding random numbers to subject lines - I don't want to send that to my users! And GMAIL destroys the css on my HTML emails. THANK YOU RDS! – pinhead Jan 15 '15 at 01:12
  • 1
    Wow, thanks for this but, how do you know about `X-Entity-Ref-ID` ? is it a gmail only thing ? I can't find anybody else talking about this in the internet :) – Adrien Rey-Jarthon May 21 '15 at 06:00
  • `X-` are private fields, so this one is likely to be Gmail specific only. – rds May 21 '15 at 13:53
  • The SMTP headers are visible in any message. – rds May 21 '15 at 13:53
  • 2
    The X-Entity-Ref-ID did not work for me; +randomstring did! Thx. – Mike N Jan 08 '16 at 09:54
  • 4
    For me `X-Entity-Ref-ID: null` did work, both for GMail as well as a client like Airmail. – thijsai Apr 25 '17 at 08:44
  • 1
    Oh my god - thank you so much for that X-Entity-Ref-ID trick! Been pulling my hair out with this issue for two days. – Dawid Dahl Aug 29 '22 at 06:37
0

The situation has changed since 2019.

I found a solution in https://workspaceupdates.googleblog.com/2019/03/threading-changes-in-gmail-conversation-view.html.

Setting a header of the form References: <---uuid---@youremailproviderhere.com>, with a unique UUID for each email is enough to solve this.

Tested a few times today and I confirm it works.

Basj
  • 41,386
  • 99
  • 383
  • 673
  • Unsure if it works – I get emails threaded even in the absence of an `X-Entity-Ref-ID` header. Just same title and sender seem enough. – kashmiri Jan 18 '23 at 13:23