Share via

Duplicate Email Delivery with Single Graph API sendMail Request

ajmalsabith 0 Reputation points
2026-05-06T04:33:31.34+00:00

We are experiencing an issue where duplicate emails are being delivered when using the Microsoft Graph API sendMail endpoint, even though the API is invoked only once from our application.

Observed Behavior:

  • Our Node.js application triggers a scheduled job (cron) once per day.
  • The sendMail API is called exactly once per execution.
  • Application logs confirm a single API request with HTTP status 202 Accepted.
  • The same email (same subject, body, attachment, and timestamp) is received twice by the same recipient(s).

Request Details:

  • Endpoint: POST /v1.0/users/{user}/sendMail
  • Response Status: 202 Accepted
  • Example Request ID: b00435e7-bc9b-4a86-b870-be22f61cc71e
  • Client Request ID: Same as above (passed via header)

Additional Observations:

  • No duplicate logs or multiple invocations detected in the application.
  • Only one instance of the application is running (PM2 single instance).
  • No retry logic implemented on the client side.
  • Duplicate emails are received at the same timestamp.

Expected Behavior:

  • A single API call should result in a single email delivery.

Actual Behavior:

  • A single API call results in duplicate email delivery.

Request: We would like to understand:

  1. Under what conditions the Graph API may deliver duplicate emails.
  2. Whether this is expected behavior due to internal retries.
  3. Recommended approach to ensure idempotent email delivery using sendMail.

Please let us know if additional logs or headers are required for investigation.We are experiencing an issue where duplicate emails are being delivered when using the Microsoft Graph API sendMail endpoint, even though the API is invoked only once from our application.

Observed Behavior:

  • Our Node.js application triggers a scheduled job (cron) once per day.
  • The sendMail API is called exactly once per execution.
  • Application logs confirm a single API request with HTTP status 202 Accepted.
  • The same email (same subject, body, attachment, and timestamp) is received twice by the same recipient(s).

Request Details:

  • Endpoint: POST /v1.0/users/{user}/sendMail
  • Response Status: 202 Accepted
  • Example Request ID: b00435e7-bc9b-4a86-b870-be22f61cc71e
  • Client Request ID: Same as above (passed via header)

Additional Observations:

  • No duplicate logs or multiple invocations detected in the application.
  • Only one instance of the application is running (PM2 single instance).
  • No retry logic implemented on the client side.
  • Duplicate emails are received at the same timestamp.

Expected Behavior:

  • A single API call should result in a single email delivery.

Actual Behavior:

  • A single API call results in duplicate email delivery.

Request:
We would like to understand:

  1. Under what conditions the Graph API may deliver duplicate emails.
  2. Whether this is expected behavior due to internal retries.
  3. Recommended approach to ensure idempotent email delivery using sendMail.

Please let us know if additional logs or headers are required for investigation.

Microsoft Security | Microsoft Graph
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.