Microsoft safelinks

279 views Asked by At

I have a site that sends links to users. When they click the link they are forwarded another email which is a simple thing to execute. I now have a problem that when I send those links to users, Microsoft's safelink feature will hit that link multiple times and the user will receive the same email multiple times. Is there a work around so that the email is only sent out once without removing the safelink? I'm using ASP.NET MVC

1

There are 1 answers

1
Heinzi On

Frame challenge: Don't make a link (HTTP GET) cause an action (such as sending a mail).

Let me quote Oded from a related question on Software Engineering SE:

A GET is defined in this way in the HTTP protocol. It is supposed to be idempotent and safe.

As for why - a GET can be cached and in a browser, refreshed. Over and over and over.

[...]

Consider what this may mean if the GET becomes a link and it gets crawled by a search engine. [...]

[...]

There is also a problem with link prefetching in some browsers - they will make a call to pre-fetch links, even if not indicated so by the page author.

Make the link show a page. On this page, but a button (HTTP POST) which causes the desired action (such as sending an e-mail) to occur.