Skip to main content

What is “Content-Transfer-Encoding”?

Content-Transfer-Encoding describes how the message’s body is encoded for safe transport over SMTP, which can only handle 7-bit ASCII text. This header is necessary because SMTP was created long before attachments, emojis, or HTML emails existed—it cannot send binary data directly.

Common encodings are `base64` and `quoted-printable`. Base64 converts every 3 bytes of binary data into 4 readable text characters, which makes attachments about 33% larger during transit. Quoted-printable is more efficient for mostly text-based content that contains a few non-ASCII characters (like accented letters).

In simpler terms, it’s like wrapping fragile goods for the journey—ensuring no corruption while crossing from one mail server to another.