'mailto:' scheme doesn't work in web application embedded in MS365 web app

Praveen Patel G 0 Reputation points
2025-12-05T09:04:12.8533333+00:00

'mailto:' scheme doesn't work in web application embedded in MS365 web app

I have created a simple HTML web page with the following code:

<a href="mailto:<your-email-address>" title="">email-address</a>

I have hosted this app on localhost. With the help of ngRok i have integrated my website on Microsoft teams tab app. Now I am able to see my application in Microsoft 365 as well. If I open app, it loads successfully. But After clicking on my email address,

I see a console error: Framing '' violates the following Content Security Policy directive: "frame-src ". The request has been blocked. Note that '' matches only URLs with network schemes ('http', 'https', 'ws', 'wss'), or URLs whose scheme matches self's scheme. The scheme 'mailto:' must be added explicitly.

Here is my CSP on config file:

<add name="Content-Security-Policy" value="default-src: 'self'; frame-src mailto:;" />

I tried adding mailto: to frame-ancestor as well. That didn't help.

Microsoft Copilot | Microsoft 365 Copilot | Development
{count} votes

1 answer

Sort by: Most helpful
  1. Sayali-MSFT 4,511 Reputation points Microsoft External Staff Moderator
    2025-12-10T09:25:16.5233333+00:00

    Hello Praveen Patel G,
    This issue occurs because Microsoft 365 and Teams run your tab inside an iframe with a strict Content Security Policy (CSP) that does not allow non-network schemes like mailto: to be framed or navigated directly. Adding mailto: to your own CSP won’t override the CSP enforced by Teams or Microsoft 365.
    Microsoft Teams and other M365 apps use strict Content Security Policy (CSP) settings (e.g., frame-src 'self' https: data: blob:). Because mailto: links are not allowed as navigation targets inside a sandboxed iframe, clicking them attempts to escape the iframe — which the CSP blocks.

    Use microsoftTeams.executeDeepLink()


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.