Set Gmail as your email client in Firefox

Firefox 3 introduces support for web-based protocol handling so instead of a desktop application taking care of irc:, im:, ftp:, mailto: and other protocol link, these addresses are passed to a defined web service provided that it is capable of parsing and processing them.

Firefox 3 ships with Yahoo! Mail and 30Boxes as bundled web protocol handlers (for email and calendars respectively) but you can easily add more as they become available.

Google for example added the necessary interface too short before the Firefox 3 release so it wasn’t included by default but you can change that.

First, you will have to enable registration of protocol web handlers from different domains.

  • Enter about:config in the location bar and press Enter to access the advanced preferences.
  • Look for gecko.handlerService.allowRegisterFromDifferentHost and double click it to set it to true.

Now click in the link below to add Gmail as a mailto: links handler.

Add Gmail as a mailto handler

You will be prompted with a confirmation info bar. Press Add Application.

You can now select Gmail as your mailto links handler from the Application page in the Options dialog.

Now when you click on mailto: links a new tab with a Gmail compose window will open. You can also or click on Send Link… in the File menu to send the current page address and title.

I suggest setting gecko.handlerService.allowRegisterFromDifferentHost back to false to prevent malicious web sites offering their own protocol handlers.

In case you need to remove Gmail as a mailto handler, in the Tools menu, select Options. In the  Applications page look for mailto in the content type column. Open the menu in the Action column and select Application Details…, select Gmail and press Remove.

Update: If clicking on the link to add Gmail still doesn’t work, access the advanced preferences (enter about:config in the location bar) and check that network.protocol-handler.external.mailto is set to true, its default value. If it isn’t double click on it to change it or right-click and select Reset.

27 thoughts on “Set Gmail as your email client in Firefox”

  1. I’m using FF3 and I changed that config value from false to true. I think the “Add Gmail as your default email client” link is broken. It didn’t pop anything up for me.

  2. Pingback:
  3. The javascript snippet is truncated. It currently reads as follows:

  4. Or, instead of changing around stuff in about:config, copy the link for “Add Gmail as your default email client” and paste it into the location bar in a tab with Gmail open and press enter.

    @Devon Young
    Any errors in the console? Tools -> Error Console (Ctrl+Shift+J)
    You might want to clear it before clicking the link.

    1. Exec-

      Thanks for the info posted 7/5/2008 1:51pm (Gmail as default e-mail client). Very helpful! I had googled a BUNCH of stuff about this problem with no luck. Your info did the trick. Awesome.

      Thanks again,


  5. I’m still getting a permission denied error even though I made the about:config changes…

    Error: [Exception… “‘Permission denied to add a protocol handler’ when calling method: [nsIWebContentHandlerRegistrar::registerProtocolHandler]” nsresult: “0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)” location: “JS frame :: javascript:navigator.registerProtocolHandler(‘mailto’,’’,’Gmail’); :: :: line 1″ data: no]
    Source File: javascript:navigator.registerProtocolHandler(‘mailto’,’’,’Gmail’);
    Line: 1

    1. Tim, you may have network.protocol-handler.external.mailto set to false. Check it through about:config and ensure it’s set to true. I’ve updated the article to mention this.

  6. Both about:config settings confirmed, the javascript still DOES NOT WORK – just opens a blank window.

  7. Nevermind, it is working…

    I was clicking from the lifehacker article, which copied your previously broken javascript.

  8. Works now, thanks! You might as well make it link to the https:// version of gmail instead of http, though.

  9. If you’re using Google apps (i.e. hosted Gmail for your domain) the compose URL is a little different. Just wanted folks who may use it to be aware that Google added it for the hosted domains, too:

    1. Ack. please edit the url to as the <domain> I included in the link got interpreted as a tag. :/

  10. Pingback: iPod, Web, How to, Internet, Computer, Free Software, Tips, Make Money Online with AhTim
  11. Pingback: o2webdev » Blog Archive » Set Gmail as your email client in Firefox
  12. These are the first directions on this topic that have actually WORKED for me! Have tried several, and the java link never worked. Very happy now…thanks!

  13. Is there a way to make Firefox open up the Gmail Compose window in a new tab or window? Right now it navigates away from the current page

  14. I did all the steps, but when I click an email link from any random webpage, it DOES open a new gmail compose window, but leaves the to address blank…..any advise? Also is there a way to have the links open the compose gmail in a new popup window?

  15. Any advice? I followed the directions, I have no errors in the error console, followed both pieces of advice for about:config and it still doesn’t appear as a mailto option in my applications. The default Mail client for windows opens instead.

Comments are closed.