Look-Ma-No-Hands HTML Tricks : E-mail Button

Updated on : 02-02-2002
No Java, no plugins, no nothing. Just a simple and stunningly useless HTML trick. It may even not always work depending on the kind/version of the browser you use. But what do I care?!

An e-mail link ordinarily looks something like this:

Mail me

or or

How's this for a change? A simple e-mail button.

This is how it's written:

<form>
<input type="button" value="E-Mail" onclick="location.href='mailto:[email protected]'">
</form>

You can write whatever you want where it says "value=...". Try typing in "E-mail me if you dare" instead of "E-mail" and then the button will show it. And make sure that you type in the mail address you want e-mail delivered to. Say, if your e-mail address is "[email protected]", then that's what you type in there. OK, let's make up that button and see how it looks. Here we go!

Let's elaborate on it and get this e-mail button to automatically fill in the subject line.

Here's the script for this button:

<form><input type="button" value="E-mail Button with Auto-filled-in Subject" onclick="location.href='mailto:[email protected]?subject=Inquiry'"></form>