Home > Web Front-end > HTML Tutorial > How to set as email link in HTML

How to set as email link in HTML

青灯夜游
Release: 2023-02-17 17:34:16
Original
19419 people have browsed it

How to set an email link in HTML: 1. Add an a tag to HTML; 2. Provide an email address to the "href" attribute of the a tag, with the syntax format "email".

How to set as email link in HTML

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

HTML Tag

tag defines a hyperlink that is used to link from one page to another. The most important attribute of the

element is the href attribute, which specifies the target of the link.

The media attribute of the tag specifies the media type of the target URL. Default value: all. Only used if the href attribute is present.

HTML - EMail link

In the a tag, provide an email address, and you can let users send emails. The format is:

<a href= "mailto:jack@kingyar.com"> 
    Send Email 
</a>
Copy after login

If the user clicks on this link, the email program installed on the user's computer, such as Lotus Notes, Outlook Express, etc., will be launched. Of course, if the user does not install email software, he will not be able to send you emails.

Default email subject and content

You can define a default email subject and content yourself:

<a href="mailto:jack@kingyar.com?subject=Feedback&body=Message"> 
    Send Feedback 
</a>
Copy after login

You can see it and add it to the web page Email linking is easy. But once a link is added to a web page, a series of troubles such as spam flying everywhere will occur. There are many guys on the Internet who specialize in collecting such mailboxes to send spam. Therefore, if you are planning to put your email link publicly on your website, you should be prepared to fight spam.

[Recommended tutorial: "html video tutorial"]

The above is the detailed content of How to set as email link in HTML. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template