The mailto is a cheap and rather old way to add email facility on your web site. A professional approach would be to use forms instead, but forms require knowledge of server-side scripting. However, mailto can be made slightly more professional if we use it properly.
Note: Mailto assumes that the visitor has configured an email client (Outlook Express, Netscape Messenger or any other) to send emails.
In its bare form a mailto looks like:
<A HREF="mailto:manish@simplygraphix.com">Send me an email</A>
And this is displayed as
When you click on the above link, your default email client will be launched (if you've configured one). You'll notice that the Subject and Body fields of the email message are empty.
With mailto, you can include a default subject and body for your emails and make it look a little more professional. Not only that, you save your visitors some typing.
<A HREF="mailto:manish@simplygraphix.com?subject=Feedback for webdevelopersnotes.com&body=The Tips and Tricks section is great">Send me an email</A>
Careful inspection of the above code will highlight two points. Firstly, the email address is separated from the other information by a ? sign and secondly, body and subject properties are themselves separated using an &.
[Those of you familiar with server-side scripting will find a similarity between this mailto tag and the GET method.]
If you click on the link above, your email client opens up with the default values of subject ("Feedback for webdevelopersnotes.com") and body ("The Tips and Tricks section is great"). However, remember the visitor can change these default values! But this fancy mailto looks better than plain one, doesn't it?
Page contents: HTML mailto attribute - HTML tips - configuring mailto in HTML - email using mailto on web site - mailto details
Add a comment