Attach Document...


Excerpted from "Occasional Downtime; The Newsletter of the HMC Academic Computing Department

Email is a very important tool at Claremont High School and throughout the Claremont Unified School District. Many of us check our email several times a day. We depend on it to communicate with colleagues, friends, and family. Email is also being used more frequently to send more than just text. We send word processing documents, image and sound files, and postscript files, among others. Such files are usually sent as attachments. Dealing with attachments is a little different than normal email and can cause some confusion and problems unless you understand how they work. This article will cover the basics of sending and receiving attachments.

How do attachments work?

The email system on the Internet is based on a protocol called SMTP (Simple Mail Transfer Protocol). It was originally designed to handle only US-ASCII characters, the set of 128 codes for the most common English characters, numbers and symbols. This was not much of a problem when text messages were the norm, but is pretty limiting today when people want to be able to send much more.

While some SMTP systems have been upgraded to handle more, you can't rely on all of the mailers your message passes through being new, so to be safe, it is necessary to encode the file first. Encoding systems such as binhex and uuencode were developed for this purpose, but required users to manually encode and decode the file themselves.

MIME, which stands for Multipurpose Internet Mail Extensions, was developed to deal with the problem of sending non-US-ASCII data through email automatically. MIME provides two types of encoding which use US-ASCII character codes to represent other types of data.

An important aspect of MIME is that it uses a header field called "Content-Type" that tells the mailer what type of information is contained in the message. The main content types are: text, multipart, application, message, image, audio, and video.

The first type of encoding is called "quoted-printable." Quoted-printable looks a lot like regular text and is used for data that is mostly ASCII text, but that has some special characters or very long lines. It works by replacing special characters with an "=" and two characters that represent the character code of that special character. Quoted-printable encoding could be used to send an email message in French, for example, where all of the accented characters would be treated as special characters.

The other type of encoding is called "base64." Base64 is used for non-text data such as image and sound files. It uses an encoding algorithm to translate the binary data of these files into a subset of the US-ASCII character set.

As an interesting aside, MIME was coauthored by an HMC alum, Ned Freed (class of '82), who also helped write PMDF Mail along with Kevin Carosso (class of '82) and Daniel Newman (class of '85).

How do I send an attachment?

How you send an attachment depends in large part on the email program that you use. In general, though, the email program takes care of most of the work of sending and receiving an attachment. All you have to do is tell the program you want to send a file and then specify which file you want to send. The mailer takes care of encoding the file and attaching it to your message. Usually the file does not appear in the body of your message, but is attached as a "rider." The recipient's mailer will then take care of decoding it and detaching it from your message when it receives the message.

Sound too easy to be true? Well, this is how it would work in an ideal world, and when both the sender and the recipient use compatible email programs it can actually be this easy. Problems arise when the sender and the recipient do not have compatible email programs. For example, if the sender's email program is MIME-compliant but the recipient's mail program is not. Or if the sender uses a Macintosh, but the recipient uses a PC. Or if the sender uses a PC, but the recipient has a UNIX workstation. In most of these cases it is still possible to send and receive the attached file, but more care has to be taken to do it right.

Attachments with Eudora

Since Eudora is one of the more widely used email programs on our campuses, we'll use it as an example. To send and receive attached files in Eudora you first need to do some preliminary configuration. For sending attachments you need to tell Eudora what encoding method you want to use. For receiving attachments you need to tell Eudora what directory on your hard drive you want detached files to be put into (usually the Attachments Folder inside the Eudora directory). Both of these configuration settings are located by selecting the Attachments icon in the Settings dialog box under the Special menu on the Macintosh, or the Options dialog box under the Tools menu on the PC. Choose an encoding method based on the email program and operating system the recipient of your message uses (see the text box for tips on choosing an encoding method). It's your responsibility to find out what kind of setup the recipient has. (If you can't find out, then AppleDouble on the Macintosh and MIME on the PC are probably the best choices.)

Once you've done this step, attaching a file is as easy as creating a new email message and then selecting "Attach Document" under the Message menu. In the file dialog box locate and select the file you want to send. The path to the file should appear in the Attachments field in the header of the message, but the file will not appear in the body of the message. That is normal. Remember, attachments are usually attached to the message as a rider. You can still type a message in the body of the email and then send it as usual.

If someone sends you an attached document, Eudora will normally automatically decode and detach the document and put it in the directory you've designated. You'll know you've received an attachment from the message Eudora inserts at the end of the email message saying that the document was detached and identifying the filename. You just need to open your attachments directory to locate the file. You can then open the file in the appropriate application, i.e. Microsoft Word for a word processing document or a graphics application for an image file.

When things don't work

Sometimes Eudora can't automatically detach and decode an attached document. This is usually because it was encoded using a method that Eudora doesn't handle. For example, Eudora Light, the freeware version of Eudora, cannot decode uuencoded files (uuencode is an encoding method used primarily on UNIX systems). So you need to manually detach the document by saving the message as a file and then use a separate utility to decode the file. For example, Stuffit Deluxe and UULite for the Macintosh and Wincode for the PC will decode a uuencoded file.

Attachments in other email programs Pine and Elm, available on our UNIX machines on campus, are other popular email programs on campus. Pine is a MIME-compliant email program and allows you to send and receive attachments. Elm has also been configured with MIME-compliance. You can check the online Pine or Elm documentation for details on how to do it. The main difference is that since most attached files are Macintosh and PC files you will need to FTP the file from the UNIX mail server to your Macintosh or PC before you can open it in the appropriate application.

Attachments are an extremely useful feature of today's email programs. We hope this article has better prepared you for both sending and receiving them.


Edited by Robs Muir, 1998
from text written by Elizabeth Hodas, HMC

Up to the CHS Web homepage

Revised: March 11, 1998 by Robs Muir
URL http://www.cusd.claremont.edu/computing/doc/email/attachments.html