177

It seems like the mailto links we're embedding in our website fail to do anything in Chrome, though they work in Firefox.

Simple example here: http://jsfiddle.net/wAPNH/

<a href='mailto:test@test.com'>hi this is a test</a>

Do we need to do something special to enable mail links in Chrome?

5
  • Works fine for me, do you have some Chrome extensions or something that would interfere?
    – Ryan Kempt
    Jul 8, 2013 at 0:08
  • Which application opens in FF when you click on the mailto link ?
    – mohkhan
    Jul 14, 2013 at 0:31
  • 1
    I tried in chrome 28 and that JSfiddle link worked fine for me (running on a mac, and opened mail.app just fine).
    – sasbury
    Jul 14, 2013 at 0:48
  • I've found that doing mailto:test%40test.com is more consistent
    – Pro Q
    May 8, 2019 at 1:55
  • That doesn't work for me too.
    – Nathan B
    Feb 24 at 15:02

19 Answers 19

160
+100

This is browser settings specific, i.e. it will behave differently depending on the user's browser settings. The user can change how mailto: links behave in chrome by visiting chrome://settings/handlers, or Chrome Settings->Content Settings->Manage Handlers...

If "email" is not listed on that page, then see this answer regarding how to proceed.

8
  • 7
    great, what's the default behavior?
    – Crashalot
    Jul 14, 2013 at 1:17
  • 8
    I believe the default is to run the mail client on the computer. I know at work, it will run thunderbird; if they have outlook installed it may run outlook, etc. Personally, it did not run gmail by default, I had to set it up that way.
    – kennypu
    Jul 14, 2013 at 1:55
  • 2
    @Crashalot nope. a mailto link is a mailto link
    – kennypu
    Jul 14, 2013 at 7:33
  • 52
    Opening chrome://settings/handlers gives me an empty box with no option to add a handler. Looks like Chrome is badly broken here: it simply will not open my configured mailer (Thunderbird) in response to a mailto link. Mar 11, 2015 at 22:15
  • 3
    @PeterFlynn it looks like chrome now will try to run the default mail client installed on the computer. Make sure thunderbird is set as the default mail client. See this link on how to do that: kb.mozillazine.org/Default_mail_client#Windows
    – kennypu
    Mar 12, 2015 at 23:15
131

This is because chrome handles the mailto in different way. You can go to chrome://settings/handlers and make sure that which is the default handler. In your case it will be none (i.e. not listed). Now go to gmail.com. You should see something like this when you click on the button beside the bookmark button.

Set mailto in chrome

If you wish to open all email links through gmail then set "Use Gmail". Now when you click on mailto button, chrome will automatically opens in gmail.

9
  • 1
    This worked for me, without first visting gmail and clicking the "allow gmail ..." there was no handler in the settings to be changed-
    – chrismarx
    May 9, 2014 at 16:21
  • 5
    Gmail? What has Gmail got to do with this? I want Chrome to open Thunderbird instead of opening a new instance of Chrome. Mar 11, 2015 at 22:19
  • 2
    This solution put me on track. But how do I change to a different option if I don't want to use gmail?
    – Gi1ber7
    Apr 19, 2017 at 14:41
  • 1
    @Gi1ber7 You can go to chrome://settings/handlers to change the mailto setting. Apr 23, 2017 at 3:34
  • 5
    i have no handlers there. wth Nov 29, 2018 at 19:47
45

In my case, chrome was associated as MAILTO protocol in Windows 10.

I changed the association to Outlook using "Default Programs" -> "Associate a file type or protocol with a program".

MAILTO is way below in the list. This screenshot may help.

enter image description here

2
  • Okay, but what if we want it to open in a specific website rather than an app? Mar 11, 2017 at 0:33
  • 2
    Using Windows 10, I had to select Outlook in the left-hand list before I could see the 'mailto' protocol checkbox in the right-hand list. Jun 20, 2017 at 13:40
24

You need to allow gmail to install the service handler for mailto protocol:

1) go to gmail

2) click the small rhombus icon at the end of address bar (screenshot)

3) enjoy

enter image description here

2
  • 3
    i see no such a thing Nov 29, 2018 at 19:46
  • @BorisGafurov is your Chrome version up-to-date?
    – Redoman
    May 26, 2020 at 4:18
17

I also experienced this issue, and eventually tracked it down to the fact that my link was within an iframe, and my web app uses https. Chrome was blocking it due to this (Chrome would open other mailto links outside of the iframe).

In mailto link not working within a frame chrome (over https), kendsnyder mentioned simply changing

<a href="mailto:...">email</a>

to

<a target="_top" href="mailto:...">email</a>

Voila, problem solved. That mailto link now works in all browsers.

8
  • I'm curious if using target=_parent" would also work. Good find.
    – Termato
    Jan 15, 2015 at 18:31
  • Thanks. Worked great. @Termato, it would probably work if it was the "top" frame. Just use target="_top" or if using JavaScript: window.top.location.href = 'mailto:...' Nov 1, 2016 at 0:05
  • Now target="_top" is also not working :( any alternate workaround. I tried with "_parent" and it is not working too. Feb 17, 2017 at 15:41
  • target="_top" worked for me within an iframe in Google Chrome Sep 5, 2017 at 11:34
  • 1
    _top and _parent also doesn't work if mailto url is in iframe comes from other domain. Classic CORRS problem. Oct 27, 2021 at 8:07
10

Fix that worked for me since my Protocol handlers was empty

https://productforums.google.com/forum/#!topic/gmail/CQMCGRvyhCM

See redfish43 reply , to sum up

For mailto: - Make sure you are logged in to Gmail and the active window is your main Gmail page (or nothing will happen). - Copy/paste this into the address bar:

javascript:navigator.registerProtocolHandler("mailto","https://mail.google.com/mail/?extsrc=mailto&url=%s","Gmail")

Add the javascript: to the front again if needed, because when you pasted it, Chrome probably trimmed everything before and including the colon. Then hit enter.

When popup window opens click on "Allow"

2
  • 1
    What about for outlook.com? Mar 11, 2017 at 0:34
  • unfortunately no longer works "Failed to execute 'registerProtocolHandler' on 'Navigator': Can only register custom handler in the document's origin."
    – darryn.ten
    Jun 9 at 10:28
7

You can try going to chrome://settings/handlers and set value for mailto: to none instead of gmail

3
  • 8
    Same here: chrome 27 has no handler for mailto defined or anything else for that matter ..wierd, maybe new security default in chrome. In FF i had to add it manually too. Jul 8, 2013 at 0:38
  • 1
    Same here. Chrome is basically broken wrt mailto links Mar 11, 2015 at 22:19
  • You can detect handler support
    – darryn.ten
    Jun 9 at 10:29
5

On macOS check also the Mail.app settings, which App is selected as default email App / associated with mailto: links:

If you ever clicked that notification on Gmail, which allows to open links in Gmail instead your App - and after this reset the Chrome handler, you have to edit this manually in your Mail.app Settings.

Screenshot

0
3

I had the same problem. The problem, by some strange reason Chrome turned himself as the default tool to open a mailto: link. The solution, put your mail client as the default app to open it. How to : http://windows.microsoft.com/en-nz/windows/change-default-programs#1TC=windows-7

Good luck

1
  • thanks this was helpful, had to unsuccessfully try all the higher ranking ones before I got here :(. Nov 29, 2018 at 20:02
2

I found this answer on a Google forum that has worked me. In the footnotes it mentions 'googleapps.exe' - I don't have this and it has still worked. Simply follow the instructions below but close down all applications before making changes to the Registry. Also I saved the existing value just in case it didn't work.


Simply type "run" in your search bar, then type "regedit" then travel to:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\shell\open\command\ 

edit (double click) "(Default)" to:

"C:\Program Files (x86)\Google\Google Apps\googleapps.exe" --domain= --mailto.google.com="%1" 

That's it! Save and close it and it should work beautifully!

Using this method prevents you from having to download the GMail Notifier, which for those of us with GTalk don't need since it does it for us. I'm not sure why Google can't solve this issue easily.. i've heard Google Apps haven't been tested fully on Windows 7 but it's obvious the same tag works with it.

Note: The only thing with this solution is you need to have the googleapps.exe file on your machine. I believe I got it with my free GooglePack from their site which has now been discontinued. I tried searching the net for a way to download it but weirdly enough it seems it's reserved only for Businesses now and there is no download link available from the web because everyone who has it streamed it using the google updater.. Odd. Anyway good luck!

1

Another solution is to implement your own custom popup/form/user control that will be universally interpreted across all browsers.

Granted this will not leverage the "mailto" out of the box capabilities. It all depends on what availability adherence you are working against. Unfortunately for myself - the mailto needed to be available to everyone by default without "inconveniencing the client".

Your decision ultimately.

1

I solved the problem using this code:

    
<button onclick="email()">Contact me !</button>	

<script>
function email() {
    var str = window.open('mailto:aaaaaa@aaaaaa.net', '_blank');
}
</script>

It worked for me like a charm !

0

The usual <a href="mailto:hi@hi.com"></a> should work, but remember you must have a default email program set on your computer. For ex, I'm using Ubuntu 14.04 and the default email is thunderbird, which works fine.

0

'Use Chrome, invite troubles' - Anonymous. (Just a symbolic reference)

Well, Chrome is notoriously famous for a lot of default security-enabled utilities, and that's where your problem originates from.

This can, however, be undone by 'setting the default email client' (as the default email client is unset), or by setting up the default handler under 'chrome://settings/handlers' (by default, it's set to 'Ignore').

1
  • 1
    Yes, this is one of the most frequent reasons. And, the suggested solution should certainly work.
    – user7763294
    Aug 11, 2019 at 19:56
0

I just had the same issue. Creating a function solved the problem:

<script>
    function sendEmail(){        
        window.location = "mailto:test@test.com";
    }
</script>

<a onclick="sendEmail();">hi this is a test</a>
0

I face same issue. because I am working in google chrome and my default app is also google chrome. So, google chrome is not able to open another chrome. So, we need to just change our default app.

You need to update default app settings.

  • search default apps.
  • Email
  • choose an app as a default app.
0

I had trouble with all of the listed solutions. I ended up heading to Gmail and running:

navigator.registerProtocolHandler("mailto", 
  "https://mail.google.com/mail/?extsrc=mailto&url=%s", "Gmail");
-3

You can use like this also,

<a href="javascript:void(0);" onclick="javascript:window.location.href='mailto:info@example.com'; return false;">info@example.com</a>

I think this is best way to resolved for chrome issues.

Thanks..

1
  • '0', not 'o' in void(). This did not appear to work very well for me. Is there something else that needs to be added?
    – Rob
    Dec 29, 2013 at 23:02
-7

Please check it this:

This is working in chrome and all browser.

<a href="mailto:test.test@gmail.com">Test</a>

try and working in great.

Not the answer you're looking for? Browse other questions tagged or ask your own question.