How To: Gmail as default mail client Ubuntu
If you press on a e-mail address on the internet it will open your default e-mail client. This is fine and handy but not if you are a Gmail user like myself.
I was thinking that this should be easy to accomplish for Gmail and i did some research. Bellow you can find the instructions how to do this.
First open up your terminal (Applications -> Accessories -> Terminal) and create a new file with your favorite editor:
vim .mail.sh
Now paste the following in tho this file for Chrome:
#!/bin/sh
google-chrome "https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`"
For Firefox:
#!/bin/sh
firefox "https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`"
Now save the file, and go to System -> Preferences -> Preferred Applications and change your mail reader to custom. In the command field but the following:
/home/peter/.mail.sh %s
of course, change my name to the name of your home folder.
All done! If you open up your browser, press a e-mail link you will notice that Google Chrome or Firefox will open up, with a new compose message, filled in with the right e-mail address you pressed. This will also work if you use Gnome-do with Google Contacts synced!