The issue of Attachments and Characters

MIME (Multipurpose Internet Mail Extensions) was created to combat a major limitation in SMTP. SMTP could only transmit 7-bit ASCII information. This limits emails to a maximum of 128 different characters. These characters are limited to the basic English/Latin alphabet, numbers, and some basic symbols and punctuation. Unfortunately, many other languages use other characters. Data attachments, like images, are also 8-bit. As a result, they cannot be sent (in their native form) through SMTP.

MIME Encoding Methods

There are 2 main Content Transfer Encoding used in MIME-encoded messages:

Quoted-Printable

The Quoted-Printable method is quite common. It encodes 8-bit characters by placing an equals sign (=) before the character's hexadecimal equivalent. This method is inefficient if most of the data is 8-bit, but it works great for mostly 7-bit data, and it means that the non 8-bit characters are still human-readable. Email text messages are usually encoded this way.

Pi=F1a Coladas and =DCbergeeks!
Is the the encoded version of Piña Coladas and Übergeeks!

Base64

Base64 is exactly what it sounds like - using base 64 for the encoding of data. It takes 3 bytes (24 bits) and splits them into 4 6-bit characters. (ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/), yielding a size ratio of 4:3. Base64 increases data size by about 135% (due to line breaks every 76 characters), so it is useful when more then a small portion of the data is 8-bit. It is commonly used when encoding attachments that are not mostly text (like multimedia).

↑ Back to Top