Set Gmail as your default mail client in Ubuntu

Posted by shaakunthala on Sat, 10/04/2008 - 12:06

Do you want Ubuntu to take you to Gmail (instead of Evolutuion) whenever you click on an email link? If your answer is Yes, then you should read this.
First, we need to write a small script. To do that, press Alt+F2, type gedit ~/gmail.sh and press Enter. The Gnome Text Editor will open. Type the following two lines and then save the file. Close the text editor.



#!/bin/sh
firefox -remote "openurl(https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed 's/mailto://'`,new-tab)"



Then, we need to permit the script to execute. For that, open a terminal window, type chmod u+x ~/gmail.sh, and press Enter.
Close the terminal window.
The last step is to set the default mail client. Click the System menu and then Preferences --> Preferred Applications. In the first tab (Internet), under Mail Reader, click the drop-down list and select Custom.
Then type ~/gmail.sh %s in the Command box. Close the window.
To test whether all are working properly, just click the following email link :) .
mailto:shaakunthala@gmail.com

Thank you!

0