"mailto" can be used within an HTML document to generate a link for sending email:
Clicking on the hyperlink automatically opens the default email client, with the destination email address pre-filled.
It is possible to specify initial values for headers (e.g. subject, cc, etc.) and message body in the URL. Blanks, carriage returns, and linefeeds cannot be directly embedded but must be percent-encoded:4
Multiple addresses can be specified:5
The address can be omitted:
Only the initial header must use a question mark (?) prepended. All subsequent headers require an ampersand (&). Should this not be the case, the scheme will not properly copy over the headers to the email client.6
See also: Address munging
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.
Berners-Lee, T.; Masinter, Larry; McCahill, M. (December 1994). "Uniform Resource Locators (URL)". Retrieved 11 September 2021. https://tools.ietf.org/html/rfc1738 ↩
Hoffman, Paul; Masinter, Larry; Zawinski, Jamie (July 1998). "The mailto URL scheme". Retrieved 26 September 2015. /wiki/Jamie_Zawinski ↩
Duerst, Martin; Masinter, Larry; Zawinski, Jamie (October 2010). "The 'mailto' URI Scheme". Retrieved 26 September 2015. /wiki/Jamie_Zawinski ↩
"Creating hyperlinks § E-mail links". MDN Web Docs. Retrieved 2019-09-30. https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Creating_hyperlinks ↩
"RFC 6068". IETF Datatracker. https://datatracker.ietf.org/doc/html/rfc6068#section-6.1 ↩