问题
I have a very simple hyperlink in my MVC App.
<a href="mailto:&subject=somesubject" class="anchoroffset nounderline shareusingemail" title="Share using Email"><div class="sprite icon-email-gray "></div></a>
Now when I click on this link in Google Chrome (v36.0.1985.125) I always notice Status cancelled under Network tab. However it does open my Outlook with the right subject. To troubleshoot this problem I disabled all the Chrome extensions too but it had no impact on the issue.

This is not a deal breaker but I am surely curious to know why this is happening and can I prevent it? I have also tested same link in IE (v11), FF (v30.0) and Safari (v5.1.7) and I didn't notice any issue there.
I have already gone thru Javascript location.href to mailto triggers a GET HTTP that gets canceled in Chrome question but it didn't help me.
Any insight into this error is much appreciated. Thanks.
回答1:
This behavior is trigerred by Chrome registering itself for mailto URLs as a default program.
The cancelled message in the Network window is normal and only indicates that Chrome won't open a new browser window, but it will still launch your email software.
Under Windows 10 (and probably previous versions) you can set the default program. First select 'default program by protocol' via the Start Menu, then locate the following entry into the list :
URL:MailTo Protocol
and change it to your email software.
As a Webmaster it's still problematic, because you won't be able to control this behavior on the computer of the people visting your web page. I'll recommend to use a contact form with a server side script instead of a mailto link.
回答2:
This happens when Windows has Chrome registered as your default mail handler, but when you haven't click the allow option in the diamonds on the right of the URL bar in Gmail to tell Chrome to allow Gmail to handle your emails.
Here is the solution if you're the end-user:
- Go to Gmail
- In the URL bar of the same tab, right side you’ll find a rhombus icon encircled in this image: https://qph.fs.quoracdn.net/main-qimg-f89b950229a8ddc54a41b8beddefed87.webp.
- Click on it. Make it allow.
- You’re ready to use mailto in Chromium (web browser) / Chrome.
However, the developer solution is indeed to add a form.
来源:https://stackoverflow.com/questions/25039988/google-chrome-mailto-status-canceled