Book contents The HTML 4.0 Sourcebook

This page is an edited version of a document originally authored by Jaimie Zawaniski of Netscape Inc. Any errors, of course, are mine (Ian Graham)

Syntax of Netscape 2.0 mailto: URLs

Summer 1996

Netscape 2.0 and newer support an experimental new syntax in mailto: URLs. This is not a part of any standard, and subject to change in the future, so users of this new syntax should be aware of the portability problem implicit in it.

The Netscape-specific syntax goes something like this:

This allows a URL to initialize the contents of a mail composition window; for example, you could put a URL in a document like

and when the user clicked on it, there would be a default subject waiting for them.

We also support this syntax when using a mailto as the POST address of a form submission; but in that case, we allow all headers, even unknown ones, to be generated, except for "dangerous" headers. These are the headers that form submissions cannot set or override the default values of:

  • Apparently-To
  • BCC
  • Content-Encoding
  • Content-Length
  • Content-Transfer-Encoding
  • Content-Type
  • Date
  • Distribution
  • FCC
  • Followup-To
  • From
  • Lines
  • MIME-Version
  • Message-ID
  • Newsgroups
  • Organization
  • Reply-To
  • Sender
  • X-UIDL
  • XRef
For example, to have a form which sent mail with a different subject, and some unknown header, one could do this:

The drawback to extending mailto: in this way is that it's not backward-compatible; browsers which only understand the older syntax (Netscape 1.1 among them) will take all that junk and dump it in the "to" field, leaving the user with an illegal mail address which they need to clean up.

Somewhere there is a proposal floating around to extend the A tag such that one could do

but that means you need to pass around HTML to do the job, rather than simply a URL. Also, this only handles the case of the subject header; to handle other fields, one would have to either allow arbitrary stuff in the A tag (obviously a bad idea) or use a format like

That all seemed much more awkward, which is why I did it this way.

There is currently no mechanism to specify a default body of the message, though that would be nice; when we add this ability, we will probably do it by adding a body= parameter to the URL (treating the body as a sort of pseudo-header.)

Some folks in the IETF-822 and MHTML working groups have suggested that ; would be a better delimiter than the & that we use today. Once there is some actual standards-body effort toward expanding the syntax of the mailto URL in this direction, we will do whatever the standard body decides.


Jamie Zawinski
jwz@netscape.com