An API that connects multiple Microsoft services, enabling data access and automation across platforms
Duplicate Email Delivery with Single Graph API sendMail Request
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
sendMailAPI 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:
- Under what conditions the Graph API may deliver duplicate emails.
- Whether this is expected behavior due to internal retries.
- 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
sendMailAPI 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:
- Under what conditions the Graph API may deliver duplicate emails.
- Whether this is expected behavior due to internal retries.
- Recommended approach to ensure idempotent email delivery using
sendMail.
Please let us know if additional logs or headers are required for investigation.