Live training: next batches coming soon. Join the waitlist:Waitlists open:Developer Training →Developer →Copilot Studio Training →Copilot Studio →

How to Send Email in SPFx with Microsoft Graph and PnPjs (2026 Update)

Our operations team asked for a small “Notify the warehouse” form on their SharePoint home page: type a few lines, press one button, and the email leaves from the person who pressed it. I reached for the PnPjs sp.utility.sendEmail() snippet I’d used in SharePoint Framework web parts for years.

It doesn’t work anymore. Microsoft retired the SharePoint SendEmail API on 10/31/2025, and today the same call comes back with a 400 error instead of an email. The replacement is Microsoft Graph, which sends from the signed-in user’s own mailbox.

In this tutorial, we’ll build a React web part that can send email in SPFx both ways: Microsoft Graph /me/sendMail through MSGraphClientV3, and the old PnPjs method, so you can see exactly what it returns now. We’ll also fix the “mailbox is either inactive, soft-deleted, or is hosted on-premise” error that guest users hit.

Quick answer: Add { "resource": "Microsoft Graph", "scope": "Mail.Send" } to webApiPermissionRequests in config/package-solution.json and have an admin approve it under SharePoint admin center > Advanced > API access. In code, get this.context.msGraphClientFactory.getClient('3') and call client.api('/me/sendMail').post({ message, saveToSentItems: true }). Graph answers 202 Accepted. Don’t use PnPjs sp.utility.sendEmail(): the SharePoint SendEmail API behind it was retired on 10/31/2025.

Here’s the finished web part after a successful send from the SPGuides site workbench:

SPFx Send Email web part sending a test email with Microsoft Graph sendMail and showing 202 Accepted
Tested withVersion
SharePoint Framework (SPFx)1.23.2 with the Heft toolchain
Node.js22 LTS
React / Fluent UI17.0.1 / @fluentui/react 8
PnPjs@pnp/sp 4.22.0
Graph clientMSGraphClientV3 from @microsoft/sp-http 1.23.2

Which Way Should You Send Email from SPFx in 2026?

There are three realistic options, and only one of them runs inside the web p