Unable to add "X-Auto-Response-Suppress : All " header into the email sent using graph API.

Madhu Ambat 0 Reputation points
2024-07-08T10:58:57.9666667+00:00

I am trying to suppress auto response email generated from recipient side by adding "X-Auto-Response-Suppress : All" into the header using graph API (Client credential flow).

According to the code added below.

I can see the "X-Custome-Header-1" in the header, I have sent but not able to see the "X-Auto-response-Suppress".

This Javscript code which I initially used

{
  "message": {
    "subject": "Test Email 12",
  "body": {
    "contentType": "Text",
    "content": "This is a test email."
  },
  "toRecipients": [
    {
      "emailAddress": {
        "address": "madhu.a@quadwave.com"
      }
    }
  ],
  "internetMessageHeaders": [
      {
        "name": "X-Custom-Header-1",
        "value": "CustomValue1"
      },
      {
        "name": "X-Auto-Response-Suppress-Layer",
        "value": "All"
      },
      {
        "name":"X-Auto-Response-Suppress",
        "value":"All"
      }
    ]
  }
}

but later changed that by removing "X-Auto-response-Suppress" and added it directly into Header property of the API like shown below.

Since "X-Auto-Response-Suppress" is not a custom header property, So I have tried calling the API "https://graph.microsoft.com/v1.0/users/help@layersystems.com/sendMail" in the header section I have added this configuration .

User's image

But still I am not able able to see it in the header and still receiving auto response email generated from the recipient side. Please help with this. Let me know if I am missing anything. Thank you .


{
  "message": {
    "subject": "Test Email 7",
  "body": {
    "contentType": "Text",
    "content": "This is a test email."
  },
  "toRecipients": [
    {
      "emailAddress": {
        "address": "madhu.a@quadwave.com"
      }
    }
  ],
  "internetMessageHeaders": [
      {
        "name": "X-Custom-Header-1",
        "value": "CustomValue1"
      }
    ]
  }
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,004 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.