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 and enter it into an email client.
It was originally defined by Request for Comments (RFC) 1738 in December 1994, expanded by <nowiki>RFC</nowiki> 2368 in July 1998, and refined by <nowiki>RFC</nowiki> 6068 in October 2010.
Syntax
Mailto URIs are composed of the scheme <code>mailto:</code> and zero, one, or more recipient addresses separated with a comma. Additionally, email headers such as <code>cc</code> or <code>subject</code> can be added as attribute-value pairs in the query component of the email.
Percent-encoding must be used for the local-part of the Email addresses and for the header values. The Domain parts of the addresses can also be encoded using percent-encoding but using IDNA-Encoding is recommended for interoperability with legacy software.
<syntaxhighlight lang="html"><a href="mailto:someone@example.com?subject=This%20is%20the%20subject&cc=someone_else@example.com&body=This%20is%20the%20body">Send email</a></syntaxhighlight>
Multiple addresses can be specified:
Security and privacy
A number of security issues are mentioned in RFC 6068, one of them being 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.
While methods exist to "harden" mailto links against harvesting—address munging and JavaScript-based address obfuscation among them—these protections can be circumvented by sufficiently sophisticated harvesting robots. Other techniques, like walling the address behind a CAPTCHA or similar "humanity check", provide security on par with that available for other contact methods, most notably web forms, which experience similar challenges with preventing spam.
