Electronic mail was designed to accept only plain text: letters, numbers, punctuation marks. Compressed files and compiled programs are examples of files that are not plain text, but what is known as binary files. Many word processors and other programs running on microcomputers (such as IBM-PC and clones, IBM PS/2, Macintosh) do not store data as plain text but as binary files. For this reason, you cannot use electronic mail to send a word processor file. One solution is to save the file as plain text (ASCII), but in doing so you lose most of the formatting of the document.
Most of this section explains the use of uuencode to convert a binary file into a pseudo-ASCII text that can be mailed, and the use of uudecode to convert such a message back into a binary file. Before sending, check with your correspondent that the document can be uudecoded on the receiving system and that the binary file can be used. Besides the following explanation, see also the man page, by typing man uuencode at the system prompt. The man page illustrates the use of uuencode with the Berkeley mail program; the purpose of the examples here is to show how to adapt it to MM. If you know how to use Berkeley mail, you may find it simpler to send uuencoded material with it.
If the file originates on your microcomputer, you need to upload it as a binary, and the same applies if you want to download a binary file that you receive. File transfer usually assumes plain text, so check on how to send and receive a binary. With Kermit, you give the command set file type binary to both Kermit programs as shown below.
$ kermit C-Kermit, 4F(095) 31 Aug 89, 4.2 BSD Type ? for help C-Kermit>set file type binary C-Kermit>receive myfile Escape back to your local Kermit and give a SEND command... [alt-x] Kermit-MS>set file type binary Kermit-MS>send myfile.wp
On the mail host, use the uuencode command to create a coded version of the file. The resulting file, file2, is approximately 35% larger than the binary file1. Since it is made of text characters, it can be sent through electronic mail.
The syntax of the command is: uuencode file1 name > file2
file1 is the name of the file you created when you uploaded the file with Kermit; it is the binary file. name is the name that is to be included in the encoded version of the file; it may or may not be the same as file1. file2 is the name of the encoded file that you are creating with the command.
In this example the binary myfile is converted to myfile.uu:
$ uuencode myfile myfile > myfile.uu
Then use MM to include myfile.uu into a message, like any file.
Message (End with CTRL/D or ESC Use CTRL/B to insert a file, CTRL/E to enter editor, CTRL/F to run text through a filter, CTRL/K to redisplay message, CTRL/L to clear screen and redisplay, CTRL/N to abort, CTRL/P to run a program and insert output.): [control-b] Insert file: my