How it works

December 19, 1998

Lisa Rein and Tim Bray

Mail Server Pages
eXtensible Mail Transaction Protocol (XMTP)

Diagram of how MSP works.

The process begins on the ship, where a digital camera is plugged into a PC and a digital image is taken of the patient's injury.

The digital image is then optimized as a JPEG file, and sent along with an HTML-based form as an ordinary e-mail attachment (multipart/related MIME message).

The e-mail is received by the XMTP server, a modified mail server that uses JavaScript to transform the pieces of the multipart/related MIME message into an XMTP document. Base64 encoding is used to "flatten" the binary JPEG file so it may be expressed textually in the XMTP document. The XMTP document is then stored in the GroveBase, where a Microsoft IIS server can access it and use it with an XSL stylesheet to transform the data it contains into an HTML page. Finally, a link to the Web page is e-mailed to a doctor to examine.

Representing the multipart MIME message in XMTP has many advantages. By default, encoding patient information in XML ensures that the consults can be indexed in the database, analyzed and routed to the correct specialist according to Consult98's pattern matching rules engine. In this way, binary images can be integrated with textual data.

The demo

Borden has created an online demonstration of XMTP so that developers can test it in an interactive fashion. The XMTP demo is available by sending e-mail to

When someone sends an e-mail message to the address, this script is invoked.

The script will return an XMTP encoding of the MIME e-mail message when it sends you a reply. Be sure to attach a binary image file so you can see the image base64 encoded and expressed in the XMTP document that is e-mailed back to you.