An analysis of the usage of mailto attribute in HTML

Source: Internet
Author: User

Recently, small size elder brother a little busy Ah, therefore, also did not want to update the content! Want to visit my blog "Yin People" do not spit groove I ah,,,,,

However, today, small-size elder brother used to me a relatively unfamiliar HTML attribute, is the mailto attribute, said to be a property bar, is not exactly correct. Because it is worth the prefix to use as an href attribute.

Its approximate function is to add a click effect to an email address, click on the email address, will jump directly to or into a computer on a mailbox software. Convenient for users to send mail more quickly and without error!

Don't say much nonsense, just go to the example!


HTML structure:

<!doctype html>

<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">

<title>html mailto Property Test </title>


<body>

<!--<a href= "Mailto:[email protected]" target= "_blank" >[email protected]</a>-->

<a href= "Mailto:[email protected]?subject=test&[email protected]&body=use mailto sample" target= "_blank" >[email protected]</a><!--mailto property requires a mail client or software on your computer, otherwise you can only copy the email address and send it on the Web page or on the QQ mailbox.

</body>

See the structure, is not bright very simple and practical ah? Of course not, he has a lot of properties and features to add!

Here's how to use it in detail:

1. Add a default title to a message

<a href= "mailto:[email protected]?subject= mail default title" >[email protected]</a>

2. Add the default CC address to the message

<a href= "Mailto:[email protected][email protected]" >[email protected]</a>

3. Add a default BCC address for mail

<a href= "Mailto:[email protected][email protected]" >[email protected]</a>

4. Add the default content to the message

<a href= "Mailto:[email protected]?body= welcome you to Phplamp Blog station-http://www.phplamp.org" >[email protected]</a>

5. Multiple email addresses

<a href= "Mailto:[email protected],[email protected]" >[email protected]</a>

6. To a comprehensive type: Add the default cc address, title, content

<a href= "mailto:[email protected][email Protected]&subject=phplamp Blog Station &body= welcome you to Phplamp Blog station-http:// www.phplamp.org ">[email protected]</a>

As can be seen from the above example, if there are multiple default values to add, and the mail address is connected to the character "?", the default value of the connection between the symbol is "&".

But the point I want to say is that this feature is for clients or software that has a message on the user's computer. Otherwise, users will need to copy the email address, and then manually paste the address on the Web page or QQ mailbox to send the message.

There is a different browser on the resolution of this property, Firefox will pop up a prompt box lets you choose what mail software to use to send mail. IE will pop up a warning box to tell you that there are no related mail software on your computer. Google and other browsers if the computer does not search for the corresponding mail software or client. There is no prompt. It will require the user to manually operate by themselves.


This article is from the "focus on Technology focus Front" blog, be sure to keep this source http://oxoxo.blog.51cto.com/9301862/1636572

An analysis of the usage of mailto attribute in HTML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.