Use Gmail for mailto: Links in Ubuntu
This is a pretty easy tip, and their are loads of different recipes around the Internet that all do pretty much the same thing. Having used Gmail for a number of years, I hate when I click on a mailto: link and the Evolution mail application opens. So some time ago I developed this tiny shell script to remedy the problem, this method should detect your preferred browser.
Just paste this code into a text file in the /usr/bin directory and name the file gmail. Be sure to make the file executable. Now, all you need to do is make the script your preferred application for mail.
1.) Select "System" on the taskbar, then "Preferences" and lastly "Preferred Applications".
2.) On the first tab, which should be the "Internet" tab, select "Custom" under "Mail Reader" from the dropdown.
3.) Paste the following command in the "Command:" box gmail %s and close the window.
The problem I run into is that you can never find mailto: links when you want one. So here is a link to test it - Email Link.
#!/bin/sh
# gmail - a script that passes mailto links to gmail in your browser
# Version 0.1 10-October-2007
# Scott Buffington (http://scottbuffington.org/)
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# Find the GPL online at: http://www.gnu.org/copyleft/gpl.html
# Get the default web browser.
BROWSER=`gconftool-2 --get '/desktop/gnome/url-handlers/http/command' | awk '{print $1}'`
# Execute browser with mailing address and strip out mailto link.
${BROWSER} "https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed -e 's/mailto:\(\/\/\)\?//' -e 's/\?/\&/' -e 's/\&subject=/\&su=/'`"Just paste this code into a text file in the /usr/bin directory and name the file gmail. Be sure to make the file executable. Now, all you need to do is make the script your preferred application for mail.
1.) Select "System" on the taskbar, then "Preferences" and lastly "Preferred Applications".
2.) On the first tab, which should be the "Internet" tab, select "Custom" under "Mail Reader" from the dropdown.
3.) Paste the following command in the "Command:" box gmail %s and close the window.
The problem I run into is that you can never find mailto: links when you want one. So here is a link to test it - Email Link.






