Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reply an email in the same the thread? with sendgrid

I am using .net with sendgrid and I want to send an email like a reply but Sendgrid sends my email like a new thread. After some researching I send my header like this:

"In-Reply-To":"<message-id>"
"Message-ID":"<message-id>"
"References":"<message-id>"

I am not sure if my headers are correct but I think the problem is in the body because I think I should not send a subject but if I don't send it, Sendgrid shows an error and if I send it, it doesn't send the email like a reply. Here is my body:

{
    "personalizations": [
        {
            "to": [
                {
                    "email": "[email protected]",
                    "name": "John Doe"
                }
            ],
            "subject": "Hello, World!"
        }
    ],
    "content": [
        {
            "type": "text/plain",
            "value": "Heya!"
        }
    ],
    "from": {
        "email": "[email protected]",
        "name": "Sam Smith"
    },
    "reply_to": {
        "email": "[email protected]",
        "name": "Sam Smith"
    }
}
like image 252
Sergio Rondon Polanco Avatar asked Dec 21 '25 21:12

Sergio Rondon Polanco


1 Answers

Threads are usually something each email client can handle differently to visualize the items in your inbox. So it's not a standard you can rely on. In Gmail and other large providers, it works if you use the same subject as the original email with a "RE: " prefix.

Here's an example: The subject of the original email: "Hello World" The subject line of your response: "RE: Hello World"

like image 194
IObert Avatar answered Dec 24 '25 11:12

IObert