The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
Hi @Haritha Errolla
Thanks for documenting your findings so clearly. Your observation is correct.
According to Microsoft documentation, delegated Mail.Send allows an app to send mail as the signed-in user and save a copy to that user’s Sent Items. Because /me/sendMail executes in the context of the signed-in user, that user must have a mailbox in Exchange Online. Guest users typically do not have a mailbox in the host tenant, so the mailbox-not-found error you’re seeing is expected.
To answer your two questions:
1.Is there an official supported approach within SPFx to send email when a guest user triggers the action?
There is no supported client-side SPFx-only method to send mail through Microsoft Graph on behalf of a guest user when that guest does not have a mailbox in the tenant.
The supported approaches are to move the actual mail sending outside the guest user context, for example:
Option 1: SPFx + backend service
Use the SPFx web part only to trigger the action, then call a backend service such as Azure Functions or Azure App Service API
The backend authenticates with application permissions (Mail.Send) and sends mail using POST /users/{mailbox-user-id}/sendMail
This ensures mail is sent from a valid mailbox, independent of the guest user’s context.
For detailed implementation of the Azure Function approach, you can create a separate thread in this community using the Azure Functions/Microsoft Graph tags to get more focused guidance.
Option 2: SPFx + Power Automate
A very common pattern is Guest clicks button in SPFx > SPFx calls flow > Power Automate sends email
-The email can be sent from a shared mailbox or service account.
-This approach avoids custom backend code and works for both internal and guest users.
Because this forum doesn’t currently have a dedicated tag for Power Platform, you may find more targeted help by posting in the Microsoft Power Platform Community. It’s an active space with knowledgeable members who can walk you through troubleshooting steps and share their experiences.
2.Can Mail.Send application permission be used directly in SPFx without a backend service?
No. Mail.Send application permission cannot be used directly from SPFx client-side code, because SPFx runs in the browser and only acquires delegated user tokens. App-only permissions require a confidential client using a client secret or certificate), which must be handled by a backend service.
For scenarios where guest users need to trigger email sending, the supported approach is usually to have SPFx call a backend service or workflow.
I hope this information is helpful.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.