X-Reply-To header not changing Reply-To in Microsoft Graph API

DJ-MoMo 0 Reputation points
2023-10-31T17:06:07.16+00:00

Here is what I'm doing in my API call:

Creating a Message object

Setting the X-Reply-To header to my custom email:


**message.Headers.Add("X-Reply-To", "custom@email.com");**

Sending the email via the Graph API

When looking at the full headers of the sent message, I can see the X-Reply-To field populated correctly. But the Reply-To remains unchanged.

I expected that setting X-Reply-To would override or change the Reply-To field as well, but that doesn't seem to be the case.

Is there something else I need to do to get X-Reply-To to actually modify Reply-To when sending through the Graph API? Or is this not possible and I have to find another approach?

Any help or insights appreciated! I'm using Microsoft 365 with the latest Graph API.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,282 questions
Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,047 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Glen Scales 4,431 Reputation points
    2023-11-01T00:33:19.2033333+00:00

    The replyTo property is strongly typed in the Graph so you just need to use that property in you request eg

    {
        "message": {
            "subject": "Meet for lunch?",
            "body": {
                "contentType": "Text",
                "content": "The new cafeteria is open."
            },
            "toRecipients": [
                {
                    "emailAddress": {
                        "address": "target@domain.com"
                    }
                }
            ],
            "replyTo": [
                {
                    "emailAddress": {
                        "address": "replyto@domain.com"
                    }
                }
            ]
        }
    }
    
    1 person found this answer helpful.

  2. LaserGecko 0 Reputation points
    2024-07-08T17:28:12.29+00:00

    The ReplyTo does get added to the email by adding "x-Reply-To"through Microsoft Graph API.

    @DJ-MoMo That is incorrect. That header is sent by MS Graph, but it is not set by you as a header. As of July 8, 2024, only custom headers are supported.

    replyTo is sent in the payload since, just like "body", "subject", and "toRecipients", it is a property of the message resource.

    If the address is not changed after being sent correctly, it's either an MS Graph error or an Entra authorization issue.

    0 comments No comments