Email Tutorials - Herong's Tutorial Examples - v1.04, by Herong Yang
Content-Transfer-Encoding: base64 - Base64 Encoded Content
This section provides an email message example with 'Content-Transfer-Encoding: base64' header to indicate that the content is Base64 encoded, commonly used for protecting non-ASCII characters.
What Is "Content-Transfer-Encoding: base64" Email Header? "Content-Transfer-Encoding: base64" specifies that the email message content is Base64 encoded. The email client tool needs to decode it to obtain the original content.
Here is a simple example of email message with the same content as the one in the previous tutorial. But it is delivered as a Base64 encoded content.
Return-Path: <joe@herongyang.com> Delivered-To: herong@herongyang.com Received: from 127.0.0.1 (localhost [127.0.0.1]) by mail.herongyang.com (Postfix) with ESMTP id 5EABD266002B for <joe>; 15 Nov 2023 06:19:34 -0500 (EST) Message-Id: <20231113111946.5EABD266002B@mail.herongyang.com> Date: 15 Nov 2023 06:19:34 -0500 (EST) From: joe@herongyang.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 5L2g5aW977yBIC0gSGVsbG8h
The main advantage of using "Content-Transfer-Encoding: base64" is that the encoded content contains 7-bit characters only, and it is much safer to be transmitted between SMTP servers.
Table of Contents
Postfix - Mail Transport Agent (MTA)
SSL/TLS Secure Connections with Postfix Server
Dovecot - IMAP and POP3 Server
SSL/TLS Secure Connections with Dovecot Server
Email Client Tools - Mail User Agents (MUA)
Mozilla Thunderbird - Mail User Agents (MUA)
PHPMailer - PHP Package for Sending Emails
►Email Message Format and Headers
Email Message Format and Example
What Are Email Message Headers
Content-Type: text/html - HTML Content
Content-Type: multipart/alternative; boundary="..."
Content-Type: multipart/mixed; boundary="..."
Content-Transfer-Encoding: 8bit - Non-ASCII Content
►Content-Transfer-Encoding: base64 - Base64 Encoded Content
Content-Transfer-Encoding: quoted-printable - 7-Bit Encoding
Subject: =?...?= - 7-Bit Encoding
From: ... - Email "From" Address
To: ... - Email "To" Addresses