Share via

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": "******@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/******@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": "******@quadwave.com"
      }
    }
  ],
  "internetMessageHeaders": [
      {
        "name": "X-Custom-Header-1",
        "value": "CustomValue1"
      }
    ]
  }
}
Microsoft Security | Microsoft Graph

1 answer

Sort by: Most helpful
  1. Michael Schmitz 1 Reputation point
    2026-03-31T08:41:43.0533333+00:00

    I could observe the same behavior with PowerShell and the Graph sendMail API:

        internetMessageHeaders = @(
          @{
            name = "X-Auto-Response-Suppress"
            value = "All"
          }
        )
    

    When I check the massage with my Microsoft-Account or my GMAIL-Account I cannot find the Header as part of it. So I think either Graph is filtering it out our EXO removes it bevor sending the E-Mail.

    0 comments No comments

Your answer

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