Getting more milage out of "mailto:"

From JoatWiki
Jump to: navigation, search

Procmail filters my incoming mail and, with the help of a Perl script, sends files to users requesting them. All in all, it's a very convenient "thing to have". To make things even more convenient, I'm abusing the "mailto" feature that IE, Netscape, Opera and Galeon supports (thanks to Michael Mauch for noting that Opera and Galeon now support the feature). The rest of this document describes the feature.

"mailto:" is a feature that was added by Netscape (correct me if I'm wrong!) to allow a browser to click on and bring up a "new message composer". Many people use it in their web pages but only in it's most basic form:

 <a href="mailto:joat@757.org">

You can also cause the URI to fill in various other portions of the message. To add a subject line, you would use:

 <a href="mailto:joat@757.org?subject=send+file+list">

Note the possible substitution of "+" signs for spaces in the subject.

To send a duplicate message to someone else:

 <a href="mailto:joat@757.org?cc=yourname@yourisp.com">

To fill in the body of the message:

 <a href="mailto:joat@757.org?body=Please send me the your file list.">

To combine any of the above features, separate them with an ampersand ("&"):

 <a href="mailto:joat@757.org?subject=send file list&body=Please send me your file list.">

You can test the above example by clicking on the following:

 mailto:joat@757.org?subject=send+file+list&body=Please+send+me+your+file+list.

(*Note:* By actually sending the message, you will get an auto-response from my Procmail recipe, listing the files that I have available.)(That is, if I still have the Procmail recipe enabled.)

The use of these features makes browsing just that much more convenient for your surfers. The mailto: option also comes in forms other that just a straight HTML link. See the sources below to view the <form> and JavaScript versions.

Related: Michael Mauch came up with a method for [Using Mutt With Galeon and Opera].

Sources:

<comments>Getting_more_milage_out_of_%22mailto:%22</comments>

Personal tools