« | »

Set Gmail as the Default Mail Client in Linux

By Studge | May 10, 2007

I use Gmail as my primary e-mail and wanted to be able to use it as my default client for my operating system.

We will be creating a script that, when activated, will call up Firefox and send us to the composition section of Gmail. Then we will set this script up as the default e-mail client and send the target e-mail address to it. So, first we will put together a simple script and name it gmailto.sh. Here is what it should be comprised of:

#! /bin/sh

firefox "https://mail.google.com/mail?view=cm&tf=0&to=
`echo $1 | sed 's/mailto://'`"

I placed this script in my /home/user/bin folder as I do all of my personal scripts and then made it executable with:

[user@localhost bin]$ chmod u+x gmailto.sh

Now all we have to do is specify this script as our default mail handler. In Fedora, using Gnome, this menu is listed under System>Preferences>More Preferences>Preferred Applications.

Preferred Applications

It is important to place the %s after calling the script in the Preferred Applications window so that it places the target address into your new message.

Topics: Linux

Share: del.icio.us | digg | reddit

RSS feed | Trackback URI

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.