While browsing on Mac, if you ever click mailto, you will experience that you will be taken to the default Mail app. If you desire to use Gmail or even some other email service, you need to make few changes.
At the broader side, the problem is not opening the links in some other email service like outlook or Thunderbird. Many of us will simply leads to a simple solution that what you have to do is to just open up the mail preferences and select the default email reader from that.
By doing so, email will simply be opened in another email client. But if you want mailto: links to open in Gmail on Firefox or safari or another browser, then doing so will not work. The actually thing to do is to cut out Mail altogether and make the changes to the browser.
Using Google Chrome as browser:
If you are a Chrome user then this thing is incredibly easy to set default mailto: links in Gmail. Open the Chrome browser and click on the double diamond icon next to the bookmark (star) icon. A popup will be shown asking allow, deny or ignore. Either you choose ‘allow’ or ‘deny’, in both ways you are set. 
Later if you change your mind to open your mailto: links in Gmail, then you have the option to change it. In the URL, type ‘chrome://settings/handlers’ and select Gmail as your mail handler.
Using Mozilla Firefox:
If you are using Firefox it is also easy thing to do. Open the preferences using the keyboard shortcut ‘command + ,’ click on the Application tab. Scroll until you find Mailto option. From the right column select your default ‘Action’.
But the above two are third party browsers, and but what about the Apple’s own browser namely Safari browser, which is used by a great number of Mac users.
Safari does not support the simple way to set the application handlers. But we will discuss the most easy method for the configuration and settings. The one of the most easy method to do this is using the mailto extension in Safari and it is also available in Opera and Chrome.
This extension works for more than simply Gmail. Just download the extension and install it, a configuration screen will appear. Choose your mail service and restart your Safari browser.
Now when you click on the mailto: links, in compose tab your email service will be opened. Important to notice, if your email is not available in the list you can add your custom URL by clicking on the ‘Custom URL’ at the bottom and add there. You can take help from the web search or can consult your email’s knowledge base to know what that URL can be.
If in future you change your mind or email service, just open Safari’s preferences and click on the extension tab and then ‘uninstall’ for removal of extension or use ‘options’ to reopen configuration page.