Each week we add a little tip to assist you in your web building. Some of the things you already know and sometimes you will come across a thing or two that you wanted but did not know where to find it. This week we will feature
"Pre-assign
Both The Subject And The Body Text Using The mailto tag"
Just about everyone (we hope) knows how to code an email address into a Web site so that visitors can click a hyperlink to send a message. It's simple and effective and lets the user define his or her mail message without having to fill in any tedious forms.
However, did you know that you can pre-assign
both the subject and the body text using the mailto tag? It's really easy and can help you quickly identify messages as they come in.
As you probably know, the HTML for the mailto: anchor tag is used like this:
<a href="mailto:Your Email Address">
Contact Me</a>
This creates a hyperlink that, when clicked, will launch the user's default mail program with the coded address in the "to" line. Now, you can take this a step further by introducing the "Subject" variable. For example, if you want people to submit a job application, you can pre-code the subject. This is important if you get lots of mail as it will quickly let you know the subject of these messages.
So, we would code the mailto like this:
<a href="mailto:Your Email Address?
Subject=Job_Application">Contact Me</A>
Note: no spaces are allowed ... use and underscore (_)
You also will notice the ? after the .com..... Be sure you include this character or it will not work.
Now, what if you wanted to pre-determine the Body Message as well? You may wish to do this if you have an offer that is always the same, such as a request for information. Let's say you're offering a free brochure. You can code the subject as "Free_Brochure" and the Body Message as "Please send me your brochure."
We code the mailto this way:
<a href="mailto:Your Email Address?Subject=Free_Brochure&Body=Please
send me your brochure.">Contact Me</A>
There you go, now you can save your visitors some time, and save yourself the anguish of strange email inquires by pre-coding your mailto expressions. The below email link will work if you want to try it and see how it looks.
Contact Me
You can also see this little tip along with many others at the below link and also on our FAQ page listed under; Email Misc. or under the key word of attributes
[ Little Tips ]
[ FAQ ]