Visual RFC.
ALL RFCs / RFC 6068
Read the RFC ↗
RFC 6068 / MAILTO LINKS AND MESSAGE TEMPLATES

Decode data once and keep HTML escaping separate

03

Percent escapes carry bytes inside URI components. They are different from HTML entity escaping and from form encodings that use plus for space.

RFC 6068 · § 5EXAMPLE
3 / 3
Decode data once and keep HTML escaping separateThree independent decoding examples. After query splitting, subject A percent26 B percent3F percent3D percent23 decodes once to A ampersand B question equals hash; percent2526 becomes literal percent26, not an ampersand from a second pass. A body has required percent0D percent0A line break, percent20 space and optional percent2B literal plus. HTML source anchor href mailto colon query subject Hi amp entity body Hello becomes a URI with one raw separator ampersand after HTML parsing, then two URI fields. The body is text/plain template content, not arbitrary MIME or an attachment.Decode the right layer, onceHTML attribute source:<a href="mailto:?subject=Hi&amp;body=Hello">After HTML parsing, URI value:mailto:?subject=Hi&body=HelloURI fields: subject=Hi | body=HelloHTML &amp; is not URI percent encoding
03
Let HTML decode its own entity layer.

The href attribute source contains &amp; between subject and body. HTML parsing yields a URI with an actual & separator, then URI parsing yields two fields. Do not treat amp;body as a field name.

Source for this drawing: RFC 6068 · Read RFC section 5 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

These pictures are analogies to help you learn. The linked RFC explains the actual rules.

Terms in this drawing
CRLF
Carriage Return followed by Line Feed, represented in a URI body by %0D%0A.
MIME
Multipurpose Internet Mail Extensions: message body formats and encodings for email.
Related RFCs and changes

“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.

KEY POINT

Split syntax first, decode data once, and escape the enclosing context separately.

  • Within query values, ? = & must be escaped when they are data rather than delimiters; # in hfields MUST be %23. Fragments are meaningless here, SHOULD NOT be used and SHOULD be ignored on resolution.
  • Body line breaks MUST be %0D%0A. Spaces SHOULD be %20; literal + is not an unambiguous space encoding, and + MAY be encoded as %2B. A final body line break MAY be added; line breaks in other hfields SHOULD NOT be used.
  • Encoding/decoding must be applied only once at the appropriate layer. URI strings MUST be decoded before creating the message and SHOULD be decoded before display. In HTML/XML source, the URI query separator & needs context escaping such as &amp;; this is not a different mailto field name.
DETAILS

The body pseudo-field supplies short text for the first text/plain part, not arbitrary MIME bodies or attachments. It uses UTF-8/percent encoding in the URI, not an added base64 layer. The HTML example intentionally omits recipients, which the user must provide before sending. Displayed markup is illustrative source, not an activated mailto link.

Read the RFC section ↗

All chapters in RFC 6068

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗