<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>

<!--
     ASCII to XML transformation by Invisible Worlds, Inc.
     http://invisible.net/
     Last transformation: 03-Feb-1999, 01:58:17

     Cannonical version of this document is at:
     http://info.internet.isi.edu/in-notes/rfc/files/rfc2368.txt

     Implementors should verify all content with
     cannonical version.  Failure to do so may result in
     protocol failures.
-->

<rfc number="2368"
     category="std"
     updates="1738, 1808">
<front>
<title>The mailto URL scheme</title>
<author initials="P.E." surname="Hoffman" fullname="Paul E. Hoffman">
<organization>Internet Mail Consortium</organization>
<address>
<postal>
<street>127 Segre Place</street>
<street>Santa Cruz</street>
<street>CA  95060</street>
<country>USA</country>
</postal>
<email>phoffman@imc.org</email>
</address>
</author>
<author initials="L." surname="Masinter" fullname="Larry Masinter">
<organization>Xerox Corporation</organization>
<address>
<postal>
<street>3333 Coyote Hill Road</street>
<street>Palo Alto</street>
<street>CA 94304</street>
<country>USA</country>
</postal>
<email>masinter@parc.xerox.com</email>
</address>
</author>
<author initials="J." surname="Zawinski" fullname="Jamie Zawinski">
<organization>Netscape Communications Corp.</organization>
<address>
<postal>
<street>501 East Middlefield Road</street>
<street>Mountain View</street>
<street>CA 94043</street>
<country>USA</country>
</postal>
<email>jwz@netscape.com</email>
</address>
</author>
<date month="July" year="1998"/>
<area>Applications</area>
<keyword>mailto</keyword>
<keyword>mail</keyword>
<keyword>uniform resource locator</keyword>
<keyword>URL</keyword>
<abstract>
<t>
   This document defines the format of Uniform Resource Locators (URL)
   for designating electronic mail addresses. It is one of a suite of
   documents which replace RFC 1738, &apos;Uniform Resource Locators&apos;, and
   RFC 1808, &apos;Relative Uniform Resource Locators&apos;. The syntax of
   &apos;mailto&apos; URLs from RFC 1738 is extended to allow creation of more RFC
   822 messages by allowing the URL to express additional header and
   body fields.
</t>
</abstract>
</front>
<middle>
<!-- RFC original section: (1.) -->
<section title="Introduction">
<t>
   The mailto URL scheme is used to designate the Internet mailing
   address of an individual or service. In its simplest form, a mailto
   URL contains an Internet mail address.
</t>
<t>
   For greater functionality, because interaction with some resources
   may require message headers or message bodies to be specified as well
   as the mail address, the mailto URL scheme is extended to allow
   setting mail header fields and the message body.
</t>
</section>
<!-- RFC original section: (2.) -->
<section title="Syntax of a mailto URL">
<t>
   Following the syntax conventions of RFC 1738 <xref target="_XREF_RFC1738"/>, a &quot;mailto&quot;
   URL has the form:
</t>
<figure><artwork>
     mailtoURL  =  &quot;mailto:&quot; [ to ] [ headers ]
     to         =  #mailbox
     headers    =  &quot;?&quot; header *( &quot;&amp;&quot; header )
     header     =  hname &quot;=&quot; hvalue
     hname      =  *urlc
     hvalue     =  *urlc
</artwork></figure>
<t>
   &quot;#mailbox&quot; is as specified in RFC 822 <xref target="_XREF_RFC822"/>. This means that it
   consists of zero or more comma-separated mail addresses, possibly
   including &quot;phrase&quot; and &quot;comment&quot; components. Note that all URL
   reserved characters in &quot;to&quot; must be encoded: in particular,
   parentheses, commas, and the percent sign (&quot;%&quot;), which commonly occur
   in the &quot;mailbox&quot; syntax.
</t>
<t>
   &quot;hname&quot; and &quot;hvalue&quot; are encodings of an RFC 822 header name and
   value, respectively. As with &quot;to&quot;, all URL reserved characters must
   be encoded.
</t>
<t>
   The special hname &quot;body&quot; indicates that the associated hvalue is the
   body of the message. The &quot;body&quot; hname should contain the content for
   the first text/plain body part of the message. The mailto URL is
   primarily intended for generation of short text messages that are
   actually the content of automatic processing (such as &quot;subscribe&quot;
   messages for mailing lists), not general MIME bodies.
</t>
<t>
   Within mailto URLs, the characters &quot;?&quot;, &quot;=&quot;, &quot;&amp;&quot; are reserved.
</t>
<t>
   Because the &quot;&amp;&quot; (ampersand) character is reserved in HTML, any mailto
   URL which contains an ampersand must be spelled differently in HTML
   than in other contexts.  A mailto URL which appears in an HTML
   document must use &quot;&amp;amp;&quot; instead of &quot;&amp;&quot;.
</t>
<t>
   Also note that it is legal to specify both &quot;to&quot; and an &quot;hname&quot; whose
   value is &quot;to&quot;. That is,
<list>
<t>
     mailto:addr1%2C%20addr2
</t></list>
</t>
<t>
     is equivalent to
<list>
<t>
     mailto:?to=addr1%2C%20addr2
</t></list>
</t>
<t>
     is equivalent to
<list>
<t>
     mailto:addr1?to=addr2
</t></list>
</t>
<t>
   8-bit characters in mailto URLs are forbidden. MIME encoded words (as
   defined in <xref target="_XREF_RFC2047"/>) are permitted in header values, but not for any
   part of a &quot;body&quot; hname.
</t>
</section>
<!-- RFC original section: (3.) -->
<section title="Semantics and operations">
<t>
   A mailto URL designates an &quot;internet resource&quot;, which is the mailbox
   specified in the address. When additional headers are supplied, the
   resource designated is the same address, but with an additional
   profile for accessing the resource. While there are Internet
   resources that can only be accessed via electronic mail, the mailto
   URL is not intended as a way of retrieving such objects
   automatically.
</t>
<t>
   In current practice, resolving URLs such as those in the &quot;http&quot;
   scheme causes an immediate interaction between client software and a
   host running an interactive server. The &quot;mailto&quot; URL has unusual
   semantics because resolving such a URL does not cause an immediate
   interaction. Instead, the client creates a message to the designated
   address with the various header fields set as default. The user can
   edit the message, send this message unedited, or choose not to send
   the message. The operation of how any URL scheme is resolved is not
   mandated by the URL specifications.
</t>
</section>
<!-- RFC original section: (4.) -->
<section title="Unsafe headers">
<t>
   The user agent interpreting a mailto URL SHOULD choose not to create
   a message if any of the headers are considered dangerous; it may also
   choose to create a message with only a subset of the headers given in
   the URL.  Only the Subject, Keywords, and Body headers are believed
   to be both safe and useful.
</t>
<t>
   The creator of a mailto URL cannot expect the resolver of a URL to
   understand more than the &quot;subject&quot; and &quot;body&quot; headers. Clients that
   resolve mailto URLs into mail messages should be able to correctly
   create RFC 822-compliant mail messages using the &quot;subject&quot; and &quot;body&quot;
   headers.
</t>
</section>
<!-- RFC original section: (5.) -->
<section title="Encoding">
<t>
   RFC 1738 requires that many characters in URLs be encoded. This
   affects the mailto scheme for some common characters that might
   appear in addresses, headers or message contents. One such character
   is space (&quot; &quot;, ASCII hex 20). Note the examples above that use &quot;%20&quot;
   for space in the message body.  Also note that line breaks in the
   body of a message MUST be encoded with &quot;%0D%0A&quot;.
</t>
<t>
   People creating mailto URLs must be careful to encode any reserved
   characters that are used in the URLs so that properly-written URL
   interpreters can read them. Also, client software that reads URLs
   must be careful to decode strings before creating the mail message so
   that the mail messages appear in a form that the recipient will
   understand. These strings should be decoded before showing the user
   the message.
</t>
<t>
   The mailto URL scheme is limited in that it does not provide for
   substitution of variables. Thus, a message body that must include a
   user&apos;s email address can not be encoded using the mailto URL. This
   limitation also prevents mailto URLs that are signed with public keys
   and other such variable information.
</t>
</section>
<!-- RFC original section: (6.) -->
<section title="Examples">
<t>
   URLs for an ordinary individual mailing address:
<list>
<t>
     &lt;mailto:chris@example.com&gt;
</t></list>
</t>
<t>
   A URL for a mail response system that requires the name of the file
   in the subject:
<list>
<t>
     &lt;mailto:infobot@example.com?subject=current-issue&gt;
</t></list>
</t>
<t>
   A mail response system that requires a &quot;send&quot; request in the body:
<list>
<t>
     &lt;mailto:infobot@example.com?body=send%20current-issue&gt;
</t></list>
</t>
<t>
   A similar URL could have two lines with different &quot;send&quot; requests (in
   this case, &quot;send current-issue&quot; and, on the next line, &quot;send index&quot;.)
<list>
<t>
     &lt;mailto:infobot@example.com?body=send%20current-
     issue%0D%0Asend%20index&gt;
</t></list>
</t>
<t>
   An interesting use of your mailto URL is when browsing archives of
   messages. Each browsed message might contain a mailto URL like:
<list>
<t>
     &lt;mailto:foobar@example.com?In-Reply-
     To=%3c3469A91.D10AF4C@example.com&gt;
</t></list>
</t>
<t>
   A request to subscribe to a mailing list:
<list>
<t>
     &lt;mailto:majordomo@example.com?body=subscribe%20bamboo-l&gt;
</t></list>
</t>
<t>
   A URL for a single user which includes a CC of another user:
<list>
<t>
     &lt;mailto:joe@example.com?cc=bob@example.com&amp;body=hello&gt;
</t></list>
</t>
<t>
   Another way of expressing the same thing:
<list>
<t>
     &lt;mailto:?to=joe@example.com&amp;cc=bob@example.com&amp;body=hello&gt;
</t></list>
</t>
<t>
   Note the use of the &quot;&amp;&quot; reserved character, above. The following
   example, by using &quot;?&quot; twice, is incorrect:
<list>
<t>
     &lt;mailto:joe@example.com?cc=bob@example.com?body=hello&gt;   ; WRONG!
</t></list>
</t>
<t>
   According to RFC 822, the characters &quot;?&quot;, &quot;&amp;&quot;, and even &quot;%&quot; may occur
   in addr-specs. The fact that they are reserved characters in this URL
   scheme is not a problem: those characters may appear in mailto URLs,
   they just may not appear in unencoded form. The standard URL encoding
   mechanisms (&quot;%&quot; followed by a two-digit hex number) must be used in
   certain cases.
</t>
<t>
   To indicate the address &quot;gorby%kremvax@example.com&quot; one would do:
<list>
<t>
     &lt;mailto:gorby%25kremvax@example.com&gt;
</t></list>
</t>
<t>
   To indicate the address &quot;unlikely?address@example.com&quot;, and include
   another header, one would do:
<list>
<t>
     &lt;mailto:unlikely%3Faddress@example.com?blat=foop&gt;
</t></list>
</t>
<t>
   As described above, the &quot;&amp;&quot; (ampersand) character is reserved in HTML
   and must be replacded with &quot;&amp;amp;&quot;. Thus, a complex URL that has
   internal ampersands might look like:
<list>
<t>
     Click
     &lt;a href=&quot;mailto:?to=joe@xyz.com&amp;amp;cc=bob@xyz.com&amp;amp;body=hello&quot;&gt;
     mailto:?to=joe@xyz.com&amp;amp;cc=bob@xyz.com&amp;amp;body=hello&lt;/a&gt; to
     send a greeting message to &lt;i&gt;Joe and Bob&lt;/i&gt;.
</t></list>
</t>
</section>
<!-- RFC original section: (7.) -->
<section title="Security Considerations">
<t>
   The mailto scheme can be used to send a message from one user to
   another, and thus can introduce many security concerns. Mail messages
   can be logged at the originating site, the recipient site, and
   intermediary sites along the delivery path. If the messages are not
   encoded, they can also be read at any of those sites.
</t>
<t>
   A mailto URL gives a template for a message that can be sent by mail
   client software. The contents of that template may be opaque or
   difficult to read by the user at the time of specifying the URL.
   Thus, a mail client should never send a message based on a mailto URL
   without first showing the user the full message that will be sent
   (including all headers that were specified by the mailto URL), fully
   decoded, and asking the user for approval to send the message as
   electronic mail. The mail client should also make it clear that the
   user is about to send an electronic mail message, since the user may
   not be aware that this is the result of a mailto URL.
</t>
<t>
   A mail client should never send anything without complete disclosure
   to the user of what is will be sent; it should disclose not only the
   message destination, but also any headers. Unrecognized headers, or
   headers with values inconsistent with those the mail client would
   normally send should be especially suspect. MIME headers (MIME-
   Version, Content-*) are most likely inappropriate, as are those
   relating to routing (From, Bcc, Apparently-To, etc.)
</t>
<t>
   Note that some headers are inherently unsafe to include in a message
   generated from a URL. For example, headers such as &quot;From:&quot;, &quot;Bcc:&quot;,
   and so on, should never be interpreted from a URL. In general, the
   fewer headers interpreted from the URL, the less likely it is that a
   sending agent will create an unsafe message.
</t>
<t>
   Examples of problems with sending unapproved mail include:
<list>
<t>
     * mail that breaks laws upon delivery, such as making illegal
       threats;
</t>
<t>
     * mail that identifies the sender as someone interested in breaking
       laws;
</t>
<t>
     * mail that identifies the sender to an unwanted third party;
</t>
<t>
     * mail that causes a financial charge to be incurred on the sender;
</t>
<t>
     * mail that causes an action on the recipient machine that causes
       damage that might be attributed to the sender.
</t></list>
</t>
<t>
   Programs that interpret mailto URLs should ensure that the SMTP
   &quot;From&quot; address is set and correct.
</t>
</section>
<!-- RFC original section: (8.) -->
<section title="IANA Considerations">
<t>
   This document changes the definition of the mailto: URI scheme; any
   registry of URI schemes should refer to this document rather than its
   predecessor, RFC 1738.
</t>
</section>
<!-- RFC original section: (9.) -->
<section title="References (BOILERPLATE)">
<t>
This RFC contained boilerplate in this section which has been moved
to the RFC2223-compliant unnumbered section &quot;References.&quot;
</t>
</section>
</middle>
<back>
<!-- BEGIN INCLUDE REFERENCES ** DO NOT REMOVE -->
<references>
<reference anchor="_XREF_RFC822">
<front>
<title abbrev="Standard for the Format of ARPA Internet">Standard for the Format of ARPA Internet Text Messages</title>
<author initials="D." surname="Crocker" fullname="D. Crocker">
<organization/>
</author>
<date month="August" year="1982"/>
</front>
<seriesInfo>STD 11</seriesInfo>
<seriesInfo>RFC 822</seriesInfo>
</reference>
<reference anchor="_XREF_RFC1738">
<front>
<title>Uniform Resource Locators (URL</title>
<author initials="T." surname="Berners-Lee" fullname="T. Berners-Lee">
<organization/>
</author>
<author initials="L." surname="Masinter" fullname="L. Masinter">
<organization/>
</author>
<author initials="M." surname="McCahill" fullname="M. McCahill">
<organization/>
</author>
<date month="December" year="1994"/>
</front>
<seriesInfo>RFC 1738</seriesInfo>
</reference>
<reference anchor="_XREF_RFC1808">
<front>
<title>Relative Uniform Resource Locators</title>
<author initials="R." surname="Fielding" fullname="R. Fielding">
<organization/>
</author>
<date month="June" year="1995"/>
</front>
<seriesInfo>RFC 1808</seriesInfo>
</reference>
<reference anchor="_XREF_RFC2047">
<front>
<title abbrev="MIME Part Three: Message Header">MIME Part Three: Message Header Extensions for Non-ASCII Text</title>
<author initials="K." surname="Moore" fullname="K. Moore">
<organization/>
</author>
<date month="November" year="1996"/>
</front>
<seriesInfo>RFC 2047</seriesInfo>
</reference>
</references>
<!-- END INCLUDE REFERENCES ** DO NOT REMOVE -->
<section title="Change from RFC 1738">
<t>
   RFC 1738 defined only a simple &apos;mailto&apos; with no headers, just an
   addr-spec (not a full mailbox.)  However, required usage and
   implementation has led to the development of an extended syntax that
   included more header fields.
</t>
</section>
<section title="Acknowledgments">
<t>
   This document was derived from RFC 1738 and RFC 1808 <xref target="_XREF_RFC1808"/>; the
   acknowledgments from those specifications still applies.
</t>
<t>
   The following people contributed to this memo or had and discussed
   similar ideas for mailto.
<list>
<t>
   Harald Alvestrand
</t>
<t>
   Bryan Costales
</t>
<t>
   Steve Dorner
</t>
<t>
   Al Gilman
</t>
<t>
   Mark Joseph
</t>
<t>
   Laurence Lundblade
</t>
<t>
   Keith Moore
</t>
<t>
   Jacob Palme
</t>
<t>
   Michael Patton
</t></list>
</t>
</section>
</back>
</rfc>
