Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

A description of Base64 MIME content transfer encoding


View products that this article applies to.

Summary

An e-mail message that is sent by using Microsoft Exchange Server may be encoded in Base64 Multipurpose Internet Message Extensions (MIME) content transfer encoding. Because of the Base64 encoding algorithm, a message or attachment cannot be read if it is not decoded first. However, this increases the message size by about 33 percent.

↑ Back to the top


More information

The Base64 encoding semantics are described in Request for Comments (RFC) 2045. This standard proposes that the algorithm be used to transport binary data over a transport that can only handle 7-bit data. To encode the data, a group of three bytes is converted into four 6-bit numbers. Each 6-bit number is then replaced by the corresponding US-ASCII character in the Base64 alphabet. Carriage Return Line Feed (CRLF) characters are inserted into the output stream to keep the line lengths less than 76 characters. When there is one extra byte, the 3-byte group is created by appending two 0-value bytes; two encoded characters are generated, and two equal sign (=) characters are appended. When there are two extra bytes, the 3-byte group is created by appending one 0-value byte; three encoded characters are generated, and one equal sign (=) character is appended.

Base64 encoding in Exchange Server

Base64 encoding is used in the following situations:
  • If you send a message that contains characters that are outside the 7bit US-ASCII range. Exchange Server is a 7-bit Simple Mail Transfer Protocol (SMTP) transport. To send an 8-bit message, the message must be encoded in Base64, and then sent by using SMTP.
  • If you send a message that contains 25 percent or more 8-bit characters.

Base64 encoding in Microsoft Exchange 2000 Server

Base64 encoding is used in the following situations:
  • If you send an SMTP message that has an attachment. For example:
    ------_=_NextPart_001_01C211A6.C0897AD3
    Content-Type: text/plain;
    charset="US-ASCII"
    Content-Transfer-Encoding: quoted-printable
    
    ------_=_NextPart_001_01C211A6.C0897AD3
    Content-Type: text/plain;
    name="testattach.txt"
    Content-Transfer-Encoding: base64
    Content-Description: testattach.txt
    Content-Disposition: attachment;
    filename="testattach.txt"
    
    naXZlIG91dCB5b3VyIHBhc3N3b3JkIG9yIGNyZWRpdCBjYXJkIG51bWJlciBpbiBh
    biBpbnN0YW50IG1lc3NhZ2UgY29udmVyc2F0aW9uLg0KICANClZlcm9uaWNhIFJ5YW4gKFZvbHQ
    DQpoaSBhZGUNClZlcYSBSeWFuIChWb2x0KSBzYXlzOg0KaSBoYXZlIGEgcHJl
    bWllciBjYWxsYmFjaw0KQWRlIEZhbW90aSBzYXlzOg0KSSJtIG9uIHRoZSBwaG9uZSB3aXRoIGE
    The second part of the MIME headers indicates that the SMTP attachment (testattach) was sent by using the Base64 encoding algorithm. Attachments that are sent to the Internet are always encoded as Base64 in Exchange 2000.
  • If you send a message that uses characters from certain character sets in the message body. Messages that use character sets from the following code pages are encoded as Base64 messages when they are sent from an Exchange 2000 computer:
    • Shift-JIS
    • EUC-KR
    • ISO-2202-JP
    • BIG5
    • ISO-2202-KR
    • GB18030
    • GB2312

↑ Back to the top


Keywords: KB323489, kbinfo

↑ Back to the top

Article Info
Article ID : 323489
Revision : 5
Created on : 5/31/2007
Published on : 5/31/2007
Exists online : False
Views : 467