Search code examples
microsoft-graph-apioffice365microsoft-graph-sdksmicrosoft-graph-mail

When sending emails using Microsoft Graph API, what's the correct way to send more than 150 MB within 5 minutes?


Background:

We have created 2 Azure single-tenant apps with the same set of permissions (Mail.Send & Mail.ReadWrite) within the same tenant. As per Graph API's documentation, we should be able to send emails of size upto 150 MB per email, through 1 app and 1 mailbox combination.

Link - https://learn.microsoft.com/en-us/graph/throttling-limits#outlook-service-limits

Problem:

Since the documentation mentions the combination, so ideally if we have 2 different Azure apps, then we should be able to send 2 separate emails of size 150 MB each (total 300 MB) within 5 minutes from the same mailbox.

But unfortunately, it does not work. We get a throttling error from Graph API when trying to draft 2nd email-

{
    "error": {
        "code": "ApplicationThrottled",
        "message": "Application is over its IncomingBytes limit."
    }
}

Question:

When the documentation mentions the combination, then why is the API not allowing to upload more than 150 MB (2 separate emails) in the same mailbox within 5 minutes using 2 different Azure apps?

Example:

  • Create Authorization token1 from App1.
  • Create a draft email in mailbox1 and upload a 140 MB file using the upload session.
  • Create Authorization token2 from App2.
  • Create another draft email in the same mailbox1 and upload a 140 MB file using the upload session. It fails at this step with the above error.

Solution

  • After creating a support ticket for Microsoft and following up with them for the last 1 month, the conclusion is that this is not allowed by design.

    Here's the updated documentation to avoid any further confusion. Now both the API behaviour and documentation match with each other:

    Updated documentation