TI Column Logo
October 1997

E-mail attachments

Every so often I receive questions about using the attachment feature of some e-mail programs. Here is a brief overview, and begin by looking at why attachments are needed. E-mail is a commonly used abbreviation for "electronic mail," which is the transmission of ASCII text messages from one computer to another over a network which interconnects the two computers.

ASCII FILES.   The basic American Standard Code for Information Interchange (ASCII) character set is supported by e-mail handling programs. It is a partial set of 128 characters that includes the 26 letters of the alphabet (times two for upper and lower case) plus the numerals and the other characters you normally find on a keyboard designed for English language use.

TEXT EDITORS allow one to edit ASCII files without embedding non-ASCII codes. One is generally limited to adding, copying and deleting characters, or groups of characters, but not enhancing the appearance by bolding, italicizing, or changing the basic size or position of selected characters. Most e-mail programs include one of these editors. If you prefer to use a word processor to create some of your e-mail messages, you need to use the save-as-text option to produce an ASCII file.

OTHER FILES.   Files produced by word processors include a lot of other codes, to control the appearance of the text and to represent images and so on. These codes are generally "non-printable" and are not recognized by the programs that handle e-mail messages. Other files -- spreadsheet, database, program, graphics and so on -- also contain many of these non-printable codes.

SENDING FILES.   If one wishes to send a non-ASCII file, such as a word processor file, over the Internet, there are two basic alternatives; "FTPing" or encoding FTP. File Transfer Protocol is the main method of sending any kind of file from one computer to another over the Internet. Modern FTP programs make this task relatively simple, especially in a Windows-type environment where the FTP program opens two windows -- one for each of the sending and the receiving computer -- and allows you to click and drag the file from one window to the other.

You can almost always open the window for your own computer, but you may not be able to open a window on your intended recipient's computer, because you need permission to write into that computer. That means you can change the content on that computer -- and generally that is not permitted. Some computers have what is called an "anonymous" FTP directory which anyone can use to connect to and transfer files.

Many times, when we want to send somebody a non-ASCII file, we find it is either impossible or inconvenient to use FTP. This is the situation where e-mail attachments are the solution.

E-MAIL ATTACHMENTS use the technique of encoding the non-ASCII file into an ASCII format, sending the file as an e-mail message, and decoding back into the original file format at the recipient's computer. There are several different encoding schemes or formats.

"Uuencode" and "uudecode" are two Unix commands. The first one is used to encode and send the file. The command is: "uuencode Myfname Yourfname | mail xxx@yyy". "Myfname" is the name of the file I want to send. "Yourfname" is the name of the received file after it is decoded, and "xxx@yyy" is the e-mail address to receive the message containing the encoded file. Use the above command with file names and an address that are appropriate for you.

The recipient has to follow three steps. Step 1 is to realize that this specific message is really an encoded file and not garbage -- it is helpful to send a prior message of explanation. Step 2 is to save the message as a file -- let's use the file name "newfile". Step 3 is to use the command "uudecode newfile" which results in a second file, called "Yourfname" (see previous paragraph) being created, which is the non-ASCII file I sent. The above sequence is basic to all encoding schemes but the actual encoding formats are different.

Binary Hexadecimal (Binhex) is another encoding scheme used with Macintosh systems.

MIME   (Multipurpose Internet Mailing Extension) has become a standard way of automatically performing the sequence of encoding and decoding as well as building this sequence into the e-mail software package. Many of these packages support MIME and provide a relatively user-friendly interface. However, some do not, so it may be useful to check with your intended recipient ahead of time.

LOCATION.   Where is your mail? This is another potential problem that, once understood, can be solved. If you are using a computer that is permanently connected to the Internet and has its own mail handling programs, you have your mail and all your other files on the same computer. If you are connecting your PC to a server on an intermittent basis, then you are likely using a mail program on the server that receives and holds your e-mail until you log on. There are two kinds of ways you can access e-mail in this case.

POP.   If you use a Post Office Protocol (POP) e-mail server, your mail is automatically downloaded to your PC.

IMAP.   If you use an Internet Mail Access Protocol (IMAP) e-mail server, you have a choice as to which messages are downloaded, but to access them you do have to download them. In either case, your e-mail program is on your PC with the rest of your files so the process of using attachments (encoding, etc.) is straightforward.

PINE.   However, if you use an e-mail program on your server, for example PINE, then your e-mail messages are on the server and your other files are likely on your PC, so you will need to add the extra step of downloading (moving files from server to PC) or uploading (from PC to server). You will likely be able to use FTP for this because you have permission to write on both server and PC. If you are connecting over a local area network (LAN) there may be other convenient file transfer mechanisms available -- such as network file system (NFS) links to make some directories on your server seem to be directories on your PC.

BETTER COMMUNICATION.   Attachments, encoding, and FTP are all part of the tool set that exists to help us extend the usefulness of e-mail. Please remember, if your e-mail message contains more than simple ASCII text, make sure your intended recipient understands what you are doing and has the complementary software to receive gracefully.

Contact the person you want to send the encoded file to. Say which encoding scheme you are using, and ask if the message can be received and decoded. Finally, do not send such mailing lists (where you may not know all the recipients.).


Robert T.H. (Bob) Alden is the chair of the IEEE Electronic Communications Steering Committee, and a former IEEE vice president.   In his other life, he is the director of the Power Research Laboratory at McMaster University in Hamilton, Ontario, Canada.   He welcomes your input via .

extracted from the IEEE website www.theinstitute.ieee.org
by Bob Alden