Mailto

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,[1] expanded by RFC 2368 in July 1998,[2] and refined by RFC 6068 in October 2010.[3]

## Contents

* 1 Syntax
* 2 Examples
* 3 Security and privacy
* 4 References

## Syntax

Mailto URIs are composed of the scheme `mailto:` and zero, one, or more recipient addresses separated with a comma. Additionally, email headers such as `cc` or `subject` 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.[3]

## Examples

"mailto" can be used within an HTML document to generate a link for sending email:

<a href="mailto:someone@example.com">Send email</a>

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 line feeds cannot be directly embedded but must be percent-encoded:[4]

<a href="mailto:someone@example.com?subject=This is the subject&cc=someone_else@example.com&body=This is the body">Send email</a>

Multiple addresses can be specified:[3]

<a href="mailto:someone@example.com,someoneelse@example.com">Send email</a>

The address can be omitted:

<a href="mailto:?subject=mailto with examples&body=https://en.wikipedia.org/wiki/Mailto">Share this knowledge...</a>

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.[5]

## Security and privacy

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.

## References

1. ↑ "Uniform Resource Locators (URL)". December 1994. https://tools.ietf.org/html/rfc1738. Retrieved 11 September 2021.
2. ↑ "The mailto URL scheme". July 1998. https://tools.ietf.org/html/rfc2368. Retrieved 26 September 2015.
3. ↑ 3.0 3.1 3.2 "The 'mailto' URI Scheme". October 2010. https://tools.ietf.org/html/rfc6068. Retrieved 26 September 2015.
4. ↑ "Creating hyperlinks § E-mail links" (in en). https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Creating_hyperlinks.
5. ↑ "RFC 6068". https://datatracker.ietf.org/doc/html/rfc6068#section-6.1.

* v
* t
* e

Uniform Resource Identifier (URI) schemes

Official|

* about
* acct
* crid
* data
* file
* ftp
* geo
* gopher
* http
* https
* info
* ldap
* mailto
* nfs
* nntp
* sip / sips
* tag
* telnet
* urn
* view-source
* ws / wss
* xmpp

Unofficial|

* coffee
* ed2k
* feed
* finger
* irc / irc6 / ircs
* ldaps
* magnet
* rsync
* ymsgr

Protocol list

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Mailto. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Mailto&oldid=4299259"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template