How to create a mailto link in HTML/XHTML
The code below shows you how to create a mailto link in HTML/XHTML.
NOTE: a mailto link will only work if you have email installed.
NOTE: the characters "%20" are used to insert a space in the text message.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Web Development Tutorials.com</title>
</head>
<body>
<p>
<a href="mailto:me@webdevelopmenttutorials.com?subject=Hello%20World">this is a mailto link</a>
</p>
</body>
</html>
The code above creates the link below:
Use the text editor below to practice what you have learned.