HTML
HTML mailto attribute | HTML mailto attribute |
|
The mailto is a quick way to add the facility of receiving feedback from visitor on your web site. With the HTML mailto, you create a link which when clicked by the visitor launches (if it's not already running) their email program with a new email message window. The visitor could then formulate the email message and send it off to you. Note: HTML Mailto assumes that the visitor has configured an email client (Outlook Express, Netscape Messenger, Thunderbird or any other) to send emails. In its simplest form, the HTML mailto requires an email address. However, mailto can be made slightly more professional if we use it properly. The Basic form of HTML mailto <A HREF=" This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ">Send'; document.write( '' ); document.write( addy_text11550 ); document.write( '<\/a>' ); //-->\n This e-mail address is being protected from spam bots, you need JavaScript enabled to view it me an email</A> A more complex HTML mailto <A HREF=" This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ?subject=Feedback'; document.write( '' ); document.write( addy_text454 ); document.write( '<\/a>' ); //-->\n This e-mail address is being protected from spam bots, you need JavaScript enabled to view it for faircube.com&body=The Tips and Tricks section is When you click on the above link, the Email Subject and the Email Body fields will be prefilled to "Feedback for faircube.com" and "The Tips and Tricks section is great" values, respectively. Careful inspection of the above code will highlight two points. Firstly, the email address is separated from the other information by a ? sign (question mark) 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.] Remember, the prefilled email Subject and email body values can be changed by the visitor! But this fancy mailto looks better than plain one, doesn't it? In addition to the body and subject, we can also provide HTML mailto with CC (Carbon Copy) and BCC (Blind Carbon Copy). This, as you would have guessed, requires us to append these values to the HTML mailto attribute just like we had done for body and subject. <A HREF=" This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ?subject=Feedback'; document.write( '' ); document.write( addy_text454 ); document.write( '<\/a>' ); //-->\n This e-mail address is being protected from spam bots, you need JavaScript enabled to view it for faircube.com&body=The Tips and Tricks section is great Advantages of HTML mailto attribute <A HREF="mailto:?subject=Check out www.faircube.com Disadvantages of HTML mailto The email address mentioned in the HTML mailto tag can be read by spambots. Spambots are programs run by spamsters that go around the web extracting email addresses from web pages. Once the email address enters a spamsters database they would be no respite from spam email. |
