Mailto
Encyclopedia
The mailto URI scheme
, as registered with the Internet Assigned Numbers Authority
(IANA), defines the scheme for Simple Mail Transfer Protocol
(SMTP) email
addresses. Though its use is not strictly defined, URL
s of this form are intended to be used to open the new message window of the user's email client when the URL is activated, with the address as defined by the URL in the "To:" field.
document to generate a link for sending email:
It is also 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 embedded but must be encoded.
The complete set of values and syntax with examples are published on MAILTO where you can copy the relevant code examples and generate code for your website.
, either the browser will display an error to the effect that no default email client exists, or the user will be subjected to a volley of technical questions by the unconfigured email client. Neither is a desirable outcome. Some web browsers such as Opera
may be able to redirect clicks on mailto links to a chosen webmail service, but the majority of browsers have no such capability.
A number of security issues are mentioned in RFC2368, however the greatest concern is that of robotic address harvesting. Mailto constructs are locatable within HTML pages by automated means which typically include the use of DOM
constructs or regular expression
s. Addresses harvested by such means are liable to be added to spam
mers' mass-mailing lists, and to thus receive large amounts of unwanted mail.
A number of methods exist to 'harden' mailto links against harvesting. However, these methods are not guaranteed to remain effective if the technology of harvesting robots is improved. Therefore, there exists an argument for the deprecation of the mailto URI in favor of other means of providing contact facilities, such as online forms.
URI scheme
In the field of computer networking, a URI scheme is the top level of the Uniform Resource Identifier naming structure. All URIs and absolute URI references are formed with a scheme name, followed by a colon character , and the remainder of the URI called the scheme-specific part...
, as registered with the Internet Assigned Numbers Authority
Internet Assigned Numbers Authority
The Internet Assigned Numbers Authority is the entity that oversees global IP address allocation, autonomous system number allocation, root zone management in the Domain Name System , media types, and other Internet Protocol-related symbols and numbers...
(IANA), defines the scheme for Simple Mail Transfer Protocol
Simple Mail Transfer Protocol
Simple Mail Transfer Protocol is an Internet standard for electronic mail transmission across Internet Protocol networks. SMTP was first defined by RFC 821 , and last updated by RFC 5321 which includes the extended SMTP additions, and is the protocol in widespread use today...
(SMTP) email
Email
Electronic mail, commonly known as email or e-mail, is a method of exchanging digital messages from an author to one or more recipients. Modern email operates across the Internet or other computer networks. Some early email systems required that the author and the recipient both be online at the...
addresses. Though its use is not strictly defined, URL
Uniform Resource Locator
In computing, a uniform resource locator or universal resource locator is a specific character string that constitutes a reference to an Internet resource....
s of this form are intended to be used to open the new message window of the user's email client when the URL is activated, with the address as defined by the URL in the "To:" field.
Example
Using "mailto" within a HTMLHTML
HyperText Markup Language is the predominant markup language for web pages. HTML elements are the basic building-blocks of webpages....
document to generate a link for sending email:
It is also 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 embedded but must be encoded.
The complete set of values and syntax with examples are published on MAILTO where you can copy the relevant code examples and generate code for your website.
Functionality issues
Mailto clickable links do not always function correctly for the site visitor. The software mechanism activated by the link requires that a default email client be established on the computer. This must be a local program, typically using the SMTP protocol to send outbound mail. With the rise in use of webmail-based email, many computers lack local email client software. Alternatively, email client software may have been preinstalled by the computer vendor, but never used or configured. When such a visitor clicks on a mailto URI in their web browserWeb browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...
, either the browser will display an error to the effect that no default email client exists, or the user will be subjected to a volley of technical questions by the unconfigured email client. Neither is a desirable outcome. Some web browsers such as Opera
Opera (web browser)
Opera is a web browser and Internet suite developed by Opera Software with over 200 million users worldwide. The browser handles common Internet-related tasks such as displaying web sites, sending and receiving e-mail messages, managing contacts, chatting on IRC, downloading files via BitTorrent,...
may be able to redirect clicks on mailto links to a chosen webmail service, but the majority of browsers have no such capability.
Security and privacy
A Mailto URL differs from a Webpage URI in that it may disclose personally-identifying information. It should never be assumed that the owner of an email address has granted permission for its publication. Therefore, due consideration should be given to the likelihood of infringement of privacy or intellectual-property rights.A number of security issues are mentioned in RFC2368, however the greatest concern is that of robotic address harvesting. Mailto constructs are locatable within HTML pages by automated means which typically include the use of DOM
Document Object Model
The Document Object Model is a cross-platform and language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. Aspects of the DOM may be addressed and manipulated within the syntax of the programming language in use...
constructs or regular expression
Regular expression
In computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...
s. Addresses harvested by such means are liable to be added to spam
E-mail spam
Email spam, also known as junk email or unsolicited bulk email , is a subset of spam that involves nearly identical messages sent to numerous recipients by email. Definitions of spam usually include the aspects that email is unsolicited and sent in bulk. One subset of UBE is UCE...
mers' mass-mailing lists, and to thus receive large amounts of unwanted mail.
A number of methods exist to 'harden' mailto links against harvesting. However, these methods are not guaranteed to remain effective if the technology of harvesting robots is improved. Therefore, there exists an argument for the deprecation of the mailto URI in favor of other means of providing contact facilities, such as online forms.