mailto is a Uniform Resource Identifier (URI) scheme for email addresses. It is used to produce hyperlinks on websites that allow users to send an email to a specific address directly from an HTML document, without having to copy it and entering it into an email client.
"mailto" can be used within an HTML document to generate a link for sending email:
<a href="mailto:email@example.com">Send email</a>
Clicking on the hyperlink automatically opens the default email client, with the destination email address pre-filled.
<a href="mailto:firstname.lastname@example.org?subject=Thisemail@example.com&body=This%20is%20the%20body">Send email</a>
Multiple addresses can be specified:
<a href="mailto:firstname.lastname@example.org,email@example.com">Send email</a>
The address can be omitted:
<a href="mailto:?to=&subject=mailto%20with%20examples&body=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMailto">Share this knowledge...</a>
Security and privacy
This section needs additional citations for verification. (September 2015) (Learn how and when to remove this template message)
A number of security issues are mentioned in RFC2368, however the greatest concern is robotic address harvesting. Mailto constructs are locatable within HTML pages by automated means which typically include the use of DOM constructs or regular expressions. Addresses harvested by such means are liable to be added to spammers' mass-mailing lists and thus to receive large amounts of unwanted mail.
- Hoffman, Paul; Masinter, Larry; Zawinski, Jamie (July 1998). "The mailto URL scheme". Retrieved 26 September 2015.
- Duerst, Martin; Masinter, Larry; Zawinski, Jamie (October 2010). "The 'mailto' URI Scheme". Retrieved 26 September 2015.
- "Creating hyperlinks § E-mail links". MDN Web Docs. Retrieved 2019-09-30.