Link to email address. Email address

Creating a link to an email address is done almost as well as a link to a web page. Instead of the URL, you specify mailto: the email address (example 1).

Example 1. Link to an email address

Valid HTML
<! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 // EN" "http://www.w3.org/TR/html4/strict.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Email Address </ title>
</ Head>
<Body>
<P> <a href= "mailto:[email protected]"> Ask questions by email </a> </ p>
</ Body>
</ Html>

This link is no different from a link to a web page, but when you click on it, the default email program runs. Therefore, the title of the link should indicate that it relates to e-mail, so that readers understand what the click will lead to.

Can I also automatically add the subject of the message by attaching to the email address via the question mark? Parameter subject = "subject of the message" (example 2).

Example 2. Setting the subject of a message

Valid HTML
<! DOCTYPE HTML PUBLIC "- // W3C // DTD HTML 4.01 // EN" "http://www.w3.org/TR/html4/strict.dtd">
<Html>
<Head>
<Meta http-equiv = "Content-Type" content = "text / html; charset = windows-1251">
<Title> Email Address </ title>
</ Head>
<Body>
<P> <a href= "mailto:[email protected]?subject=Victor HTML question> > Ask questions by email </a> </ p>
</ Body>
</ Html>

When the mail program starts, the Subject field will be filled in automatically.

Copyright © www.htmlbook.ru