Set Gmail as your email client in Firefox

By Percy Cabello

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.

Posted on July 5, 2008 - 1:01 pm || More on News, SeaMonkey

Comments

Tim Schmidt

July 5, 2008 1:01 pm

The javascript link to register it appears to be bad!

Reply

Devon Young

July 5, 2008 1:01 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

July 5, 2008 1:01 pm

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

Reply

Percy CabelloJuly 5th, 2008 at 1:53 pm

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

Reply

foxiewire.com

July 5, 2008 1:01 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

July 5, 2008 1:01 pm

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

Reply

Exec

July 5, 2008 1:01 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 RobertsFebruary 4th, 2009 at 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

Reply

Tim Schmidt

July 5, 2008 1:01 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: “0×8057001e (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 CabelloJuly 5th, 2008 at 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.

Reply

Tim SchmidtJuly 6th, 2008 at 11:41 am

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

Reply

Alvin Brinson

July 5, 2008 1:01 pm

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

Reply

Alvin Brinson

July 5, 2008 1:01 pm

Nevermind, it is working…

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

Reply

Fitch

July 5, 2008 1:01 pm

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

Reply

kev

July 6, 2008 1:01 pm

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

kevJuly 6th, 2008 at 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. :/

Reply

steveballmer

July 6, 2008 1:01 pm

Hotmail is much, much, mucho better!

Reply

iPod, Web, How to, Internet, Computer, Free Software, Tips, Make Money Online with AhTim

July 10, 2008 1:01 pm

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

July 10, 2008 1:01 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

July 14, 2008 1:01 pm

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

Reply

o2webdev » Blog Archive » Set Gmail as your email client in Firefox

July 18, 2008 1:01 pm

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

JeffW

July 26, 2008 1:01 pm

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

Reply

ArtMama

September 4, 2008 1:01 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

November 2, 2008 1:01 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

September 2, 2009 1:01 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

October 5, 2009 1:01 pm

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

Reply

Allie

February 8, 2010 1:01 pm

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

Leave Comment