This DRAFT document describes how a mailto client should parse a mailto URI into a compose form and how it should handle duplicate TO, CC, BCC, SUBJECT and BODY hnames.
Introduction
When a mailto client is passed a mailto URI, the client creates a compose form and uses the information from the URI to fill in the TO, CC, BCC, SUBJECT and BODY fields.
In your mailto client's compose form, you should get the following results.
To:
Cc:
Bcc:
Subject:
The client should accomplish this by parsing the mailto URI according to the rules below.
Parsing a mailto URI into a compose form.
CC: Join all non-empty CC hvalues with %2C%20 and decode.
BCC: Join all non-empty BCC hvalues with %2C%20 and decode.
TO: Join all non-empty TO hvalues with %2C%20 and decode.
SUBJECT: Decode the last SUBJECT hvalue. Use it even if it's empty and even if there's a previous subject hvalue that is not empty.
BODY: Join the first non-empty BODY hvalue and all BODY hvalues after that (even if they're empty) with %0D%0A and decode.
Mailto URIs are parsed left to right.
Addresses should appear in the fields in the same order they appear in the URI.
Matching of hnames is case-insensitive.
If a decoded hvalue contains errors, error-fixing may be applied by the client to make the value usable.
If a decoded hvalue does not fit the user input scheme of its corresponding field, the client may modify the value to fit that scheme. However, the resulting header for the field in the outgoing message should still reflect the unmodified value unless error-fixing was applied, in which case the unmodified but error-fixed value should be reflected.
In a mailto URI, a + character represents itself and not a space. For forms with action="mailto:", browsers need to submit spaces as %20 and NOT +.
Copying data
The rules above should also be followed when a UA parses a mailto URI to generate a TO, BCC, CC, SUBJECT or BODY value that will later be inserted into the corresponding field of a mail client compose form.
An example of this is right-clicking on a mailto link in a browser and selecting "Copy e-mail address" where the TO rule should be followed.