mailto handling

First, backup the registry entry we’ll hack up.

HKEY_CLASSES_ROOTmailto

Save the following text to a file and give it a name (whatever you desire) and make the extension .cmd or .bat.
[codesyntax lang=”dos” title=”mailto_handle.cmd”]

@echo off

set email_to=%1
: strip mailto:
set email_to=%email_to:~7%

: ### GMAIL ###
start iexplore "https://mail.google.com/mail/?ui=1&view=cm&fs=1&to=%email_to%#compose"

: ### YAHOO ###
:start iexplore "http://compose.mail.yahoo.com/?to=%email_to%&subject=&body="

: ### LIVE/HOTMAIL ###
:start iexplore "http://mail.live.com/mail/EditMessageLight.aspx?n=&to=%email_to%&cc=&subject=&body="

[/codesyntax]

Then, modify:

HKEY_CLASSES_ROOTmailtoshellopencommand “Default”

Set the default value to the path where you saved the above script. Make sure you add a %1 at the end also. In my case, I did:

C:usersownerdesktopmailto.cmd %1

Now, go visit https://techish.net/pub/mailto.html and click on the “mailto” link.

If all goes well, you should be composing a new email. Make sure, if IE isn’t the default browser, that you log into the webmail service FIRST before you click a mailto link otherwise you’ll be forced to log in and have to retry the script.

Also, you don’t have to use “iexplore” in the above script, I just did because it’s easy.

When you’re done testing, double-click on your .REG file you created when you backed up the “mailto” key at the beginning… You did backup, right?  😉  This will return your system to it’s default settings for “mailto” handling.

Concept taken from:  http://kris.kalish.net/2011/08/use-webmail-as-the-default-mailto-handler-in-windows/

If I had more time, I’d expand on the SUBJECT, CC, BODY parts for each but, frankly, I don’t. 😛

Leave a Reply

Your email address will not be published. Required fields are marked *