Email Tutorials - Herong's Tutorial Examples - v1.04, by Herong Yang
Content-Transfer-Encoding: 8bit - Non-ASCII Content
This section provides an email message example with 'Content-Transfer-Encoding: 8bit' header to indicate that the content contains 8-bit bytes, commonly used for UTF-8 encoded Unicode characters.
What Is "Content-Transfer-Encoding: 8bit" Email Header? "Content-Transfer-Encoding: 8bit" specifies that the email message content contains 8-bit bytes (all 8 bites are used in each byte).
If "Content-Transfer-Encoding" header is not provided, the default of "Content-Transfer-Encoding: 7bit" is assumed. In this case, the message content should contain 7-bit bytes (the most significant bit is set to 0).
The default of "Content-Transfer-Encoding: 7bit" is good enough, if you just want to send email messages in ASCII characters.
If you want to send UTF-8 encoded Unicode characters, you need to add the "Content-Transfer-Encoding: 8bit" header. Here is a simple example:
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: 8bit
你好! - Hello!
Note that "Content-Type: text/plain; charset=utf-8" header is added to specify that the content contains UTF-8 encoded Unicode characters.
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