Set Gmail as your email client in Firefox
Posted by Percy Cabello on July 5th, 2008 • Tags:
ShareThis

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.

Comments
Tim Schmidt said on July 5, 2008, 1:11 pm:

The javascript link to register it appears to be bad!

Reply

Devon Young said on July 5, 2008, 1:27 pm:

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.

Reply

Fitch said on July 5, 2008, 1:31 pm:

The link doesn’t work right now, can you check to see if this works?

Reply

Percy Cabello replied on July 5th, 2008, 1:53 pm:

Sorry about that. I’ve corrected it and is working now.

foxiewire.com said on July 5, 2008, 1:42 pm:

Set Gmail as your email client in Firefox – Mozilla Links…

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…

clem said on July 5, 2008, 1:49 pm:

The javascript snippet is truncated. It currently reads as follows:
javascript:navigator.registerProtocolHandler(

Reply

Exec said on July 5, 2008, 1:51 pm:

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.

Reply

Mike Roberts replied on February 4th, 2009, 10:32 pm:

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,

Mike

Tim Schmidt said on July 5, 2008, 2:21 pm:

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

Error: [Exception... "'Permission denied to add http://mail.google.com/mail/?extsrc=mailto&url=%sas a protocol handler' when calling method: [nsIWebContentHandlerRegistrar::registerProtocolHandler]” nsresult: “0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)” location: “JS frame :: javascript:navigator.registerProtocolHandler(‘mailto’,'http://mail.google.com/mail/?extsrc=mailto&url=%s’,'Gmail’); :: :: line 1″ data: no]
Source File: javascript:navigator.registerProtocolHandler(‘mailto’,'http://mail.google.com/mail/?extsrc=mailto&url=%s’,'Gmail’);
Line: 1

Reply

Percy Cabello replied on July 5th, 2008, 2:38 pm:

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.

Tim Schmidt replied on July 6th, 2008, 11:41 am:

Yep, that was it. No idea how that setting got that way but it worked like a charm now! Thanks, Percy!

Alvin Brinson said on July 5, 2008, 4:25 pm:

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

Reply

Alvin Brinson said on July 5, 2008, 4:27 pm:

Nevermind, it is working…

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

Reply

Fitch said on July 5, 2008, 8:30 pm:

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

Reply

kev said on July 6, 2008, 8:29 am:

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:

https://mail.google.com/a//mail/?extsrc=mailto&url=%s

Reply

kev replied on July 6th, 2008, 8:31 am:

Ack. please edit the url to https://mail.google.com/a/DOMAINNAMEHERE/mail/?extsrc=mailto&url=%s as the <domain> I included in the link got interpreted as a tag. :/

steveballmer said on July 6, 2008, 7:17 pm:

Hotmail is much, much, mucho better!

Reply

Set Gmail as Default Email Client in Firefox…

If you’re new here, you may want to subscribe to my RSS feed. Remember to Digg it or Stumble it, if you enjoyed this post! :) I believe most of blogger here own a Gmail account. You might using email client to access Gmail with IMAP. How about if we …

user said on July 10, 2008, 5:38 pm:

some kind of mixed up with links? i’m visiting this page at –> http://mozillalinks.org/wp/2008/07/seamonkey-1110-update-available-now/

Reply

simon said on July 14, 2008, 12:16 pm:

Ditto as “user” (comment 12) title and address are mismatched.

Reply

[...] for gecko.handlerService.allowRegisterFromDifferentHost and double click it to set it to [...]

JeffW said on July 26, 2008, 2:12 am:

how about adding this for other webmail systems, mail.com, etc.

Reply

ArtMama said on September 4, 2008, 11:55 pm:

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!

Reply

Joe said on November 2, 2008, 5:59 pm:

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

Reply

John said on September 2, 2009, 4:36 pm:

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?
Thanks!

Reply

Tony said on October 5, 2009, 8:25 pm:

Would also like to know how to open mailto link in a new tab

Reply

Allie said on February 8, 2010, 9:26 am:

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.

Reply