Tuesday, May 03, 2005

Shortcuts to Launch E-mail Messages

I would like to put a shortcut on my desktop that will start Microsoft Outlook with a specific address or list of addresses entered in the To field. Is there any way to do this?
Tom Collen

Yes, you can create a shortcut to launch a new e-mail message that has the recipient and various other fields preloaded with the data of your choice. We'll start with a simple shortcut that just opens a blank new e-mail message in your default e-mail client. Right-click on the desktop and choose New Shortcut. The Create Shortcut wizard will prompt you for the location of the item—enter mailto: and click on Next. Enter a name for the shortcut and click on Finish. Double-click on the new shortcut to make sure it correctly launches a new, blank e-mail message.
Now we'll define a recipient. Right-click on the shortcut you just created, choose Properties from the menu, and edit the URL field. Add two e-mail addresses separated by a comma, and click on OK (for example mailto:bill@gates.com, steve@ballmer.com) . Launch the shortcut and check whether your e-mail program accepts the addresses. If it doesn't, change the separator between the addresses from a comma to a semicolon. The comma is technically correct, per the RFC 2368 document that defines the mailto: protocol, but some clients (including Outlook) require a semicolon instead.

You can add other fields to the URL using the form name=value. The first such field must be preceded by a question mark, and any additional fields must be preceded by an ampersand. The cc= and bcc= fields can be used to add recipients, the subject= field defines the subject, and you can even include a little text for the message itself with the body= field. The subject= and body= fields are tricky, though, because many special characters must be encoded. Every space has to be replaced by %20, and any new lines in the message body are represented by %0D%0A. Beyond that, it's easiest to avoid any characters other than letters, numbers, and these few safe punctuation marks: $ - _ . + ! * ' ( ) , (dollar sign, hyphen, underscore, period, plus, exclamation mark, asterisk, single quote, open parenthesis, close parenthesis, and comma).

Here's a sample mailto: URL that uses all the elements described above. It creates an e-mail with a particular subject and body and sends it to several recipients:

mailto:santa@northpole.com;boss_elf@ northpole.com?cc=rudolph@northpole. com&subject=This%20week&body=Been%20 good%20again.%0D%0AReally!

Some e-mail clients, particularly older ones, have trouble with complex mailto: URLs. Outlook 97 didn't properly handle multiple fields in the URL, nor did versions of Outlook Express before 5.0. That's why it's important to start simple the first time you try.

No comments: