How do I make mailto: links open gmail in Ubuntu?

18

3

I've tried using this How-To Geek guide, but it doesn't work. Running the script from the terminal works (although I had to change its permissions first), but clicking on a mailto: link does nothing.

Note: I am using the Chromium Daily Builds for my browser. I would mailto: links in all applications to point to gmail, not just the ones that I click on in my browser.

Matthew

Posted 2009-08-30T19:08:44.123

Reputation: 11 686

Answers

11

As of Ubuntu 10.04, you can simply install the desktop-webmail package. The first time you click a mailto: link, it will ask you to pick your webmail provider. After that, all mailto: links will open in the webmail provider of your choice.

Matthew

Posted 2009-08-30T19:08:44.123

Reputation: 11 686

It works as of 15.10. However the application must first be selected from "Default Applications" as Eponymous decried. The answer should be edited to include that. – user362515 – 2015-12-15T17:27:04.623

1this no longer works in 11.04 – wim – 2011-08-30T05:44:50.097

@wim: I'm not currently running 11.04. Can you explain why it doesn't work? Does desktop-webmail not exist? Or is there a different problem? – Matthew – 2011-08-30T14:57:47.497

There is not an option to select Desktop Webmail as the Mail Reader in System -> Preferences -> Preferred Applications -> Internet -> Mail Reader, you have to do some mucking around to get it to appear in that combo box. – wim – 2011-08-30T23:43:17.553

@wim: Because we want this page to be useful to anyone who stumbles across it, could you post the details of the required mucking around? – Matthew – 2011-08-31T16:06:45.607

1It involves making some changes in file /usr/share/applications/desktop-webmail.desktop, and too much to post in a comment.

In 11.04 it's easier just to use an alternate method:

  1. install gnome-gmail
  2. edit ~/.local/share/applications/mimeapps.list adding line:

x-scheme-handler/mailto=gnome-gmail.desktop – wim – 2011-09-01T00:14:22.223

1In 12.10 it is very easy: install desktop-webmail. Then go to "System Settings" (search from the dash), select "Details" near the bottom. Select Default Applications" then "Desktop Webmail" from the dropdown for mail applications. (Works for Yahoo! as well) – Eponymous – 2013-03-07T23:13:17.220

3

In my gnome-default-applications-properties, I set the following custom mail reader:

gnome-open https://mail.google.com/mail/?extsrc=mailto&url=%s

(In gnome-default-applications-properties, also make sure that the default browser is set to Chrome/Chromium.)

Note that this only affects external applications (e.g. gnome-terminal) that invoke a mail agent. mailto: links within Chromium itself work as of r25100. (Chromium Bug 20696)

Phil

Posted 2009-08-30T19:08:44.123

Reputation: 476

I've picked this as the accepted answer, but you might want to edit it to include Days_of_Ruin's tip--none of this will work in Chromium until mailto: handling is implemented. – Matthew – 2009-09-02T13:20:32.890

1

Good idea, done. I found out that mailto: support in Chromium itself was committed yesterday (r25100), so a daily build should pick it up soon. The implementation calls out to xdg-open so I believe that once you have configured gnome-default-applications-properties to use Gmail as above, the setting should carry over to Chromium. See http://code.google.com/p/chromium/issues/detail?id=20696 for the details.

– Phil – 2009-09-02T21:26:02.143

I just updated Chromium from the daily PPA and mailto: now works. – Matthew – 2009-09-02T21:29:48.593

1For some reason using your command in "Preferred Applications" opens a "compose" tab for gmail, but with a blank "To: " field. Any idea why? – Matthew – 2009-11-12T22:03:07.147

I had success with one Ubuntu installation but not another. I'm afraid it's a regression between releases, but haven't had time to track it down... – Phil – 2009-11-23T03:15:51.880

1

Since you are using Chrome, you can install an extension which redirects all mailto links to Gmail.

Sirupsen

Posted 2009-08-30T19:08:44.123

Reputation: 630

1

I use the daily builds too and when I click on a mailto link it doesn't do anything. I don't think that they have implemented mailto handling yet.

Alvin Row

Posted 2009-08-30T19:08:44.123

Reputation: 595

I think you are right--using Phil's tip, mailto: links everywhere but Chromium now work. – Matthew – 2009-09-02T01:19:14.227

0

are you using firefox? if so it doesn't really matter if you are using different OS, try this redirect open mail-to link to Gmail in Firefox

Go to Toos > Options > Applications (Search for ) mailto

Under the Action Drop down menu Click Use Gmail or other applications, because this by default it will launch Microsoft Office Outlook. By doing this now you can send email and click the link right inside your browser without worry the Outlook bother you ever again.

Jonathan

Posted 2009-08-30T19:08:44.123

Reputation: 1 857

Thanks for your answer, but I am using Chromium. I've edited my question to show that. – Matthew – 2009-08-30T19:18:33.997

0

On debian wheezy, all you need is:

$ sudo apt-get install gnome-gmail

I could not get the magic javascript code to work (from: http://updates.html5rocks.com/2012/02/Getting-Gmail-to-handle-all-mailto-links-with-registerProtocolHandler)

malat

Posted 2009-08-30T19:08:44.123

Reputation: 981