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

Piyush Chugh 20 Reputation points
2024-06-25T08:53:13.3+00:00

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.
Microsoft 365
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,116 questions
Outlook
Outlook
A family of Microsoft email and calendar products.
4,002 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,272 questions
{count} votes

Accepted answer
  1. Yakun Huang-MSFT 6,415 Reputation points Microsoft Vendor
    2024-06-26T02:53:07.4766667+00:00

    Hi @Piyush Chugh

    According to the restriction documentation, you can know that the limit is an Outlook service limit, not a Graph API limit, and the maximum upload of a mailbox in 5 minutes is 150MB, so 2 applications cannot make a mailbox upload more than 150MB in 5 minutes.

    What is possible, however, is that an application can upload files up to 150MB in 5 minutes from 2 different mailboxes simultaneously.

    Screenshot 2024-06-26 104818

    Therefore, it is impossible to upload two 140MB files in the same mailbox within 5 minutes at the same time. The feasible solution is:

    1. You can use one application to control the upload of two mailboxes at the same time
    2. Use one email address to upload files, but upload files in sequence. After uploading a file, wait for more than 5 minutes before uploading another file.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful

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.