Api graph error MailboxNotEnabledForRestApi

Renaud SALVIGNAC 0 Reputation points
2024-10-21T06:22:37.0166667+00:00

Hello,

I would like to develop an application that allows users to send emails using their Office365 address.

I have two professional Microsoft accounts in different tenants. I created my application with the first account and invited my second account as an external user to the tenant. The application is registered as a multi-tenant app, and I’m using the endpoint .../organizations/oauth2/v2.0/authorize to retrieve the authorization code.

When testing with my second account, everything works fine, and the application successfully sends emails. However, for most other external users I’ve invited, I encounter the error MailboxNotEnabledForRestApi.

I’ve read on several forums that this could be a licensing issue because external users cannot use the license from their own tenant as they are considered part of the tenant where the app is registered.

Is it possible for external users to send emails through my application? And a second question, why are some external users, who don’t have licenses in my tenant, still able to send emails through my app?

Here are the permissions requested by the application: openid profile email offline_access Mail.Read Mail.ReadWrite Mail.Send User.Read

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,899 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rajat Vashistha-MSFT 265 Reputation points Microsoft Vendor
    2025-01-17T08:48:10.41+00:00

    Hi @Renaud SALVIGNAC,

    Thank you for contacting Microsoft!

    Guest users do not have a mailbox within resource tenants; they only have mailboxes in their "home" tenant. This is why you are encountering the "MailboxNotEnabledForRestApi" error when trying to send emails.

    Since your app is configured as a multi-tenant application, please ensure that each tenant/user consents to the required scopes

    You can refer to the following documentation for more details:

    https://learn.microsoft.com/en-us/entra/identity-platform/howto-convert-app-to-be-multi-tenant

    User's image

    For additional information, you might find these similar posts helpful:

    https://learn.microsoft.com/en-us/answers/questions/1443298/mailboxnotenabledforrestapi-error-on-personal-micr

    https://learn.microsoft.com/en-us/answers/questions/1161425/graph-api-mailboxnotenabledforrestapi-the-mailbox

    Hope this helps.

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

    0 comments No comments

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.