Mailto

From Vero - Wikipedia
Jump to navigation Jump to search

Template:Short description Template:Confused Template:Lowercase 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,<ref>Template:Cite web</ref> expanded by RFC 2368 in July 1998,<ref>Template:Cite web</ref> and refined by RFC 6068 in October 2010.<ref name="rfc6068">Template:Cite web</ref>

Examples

"mailto" can be used within an HTML document to generate a link for sending email: <syntaxhighlight lang="html"><a href="mailto:someone@example.com">Send email</a></syntaxhighlight>

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:<ref>Template:Cite web</ref> <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:<ref name="rfc6068"/> <syntaxhighlight lang="html"><a href="mailto:someone@example.com,someoneelse@example.com">Send email</a></syntaxhighlight>

The address can be omitted: <syntaxhighlight lang="html"><a href="mailto:?subject=mailto%20with%20examples&body=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FMailto">Share this knowledge...</a></syntaxhighlight>Only the initial header should be prepended with a question mark. All subsequent headers require an ampersand. If this convention is not followed, the scheme will not properly copy over the headers to the email client.<ref>Template:Cite web</ref>

Security and privacy

Template:See also

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.

References

<references /> Template:URI scheme