Subject: =?...?= - 7-Bit Encoding

This section provides an email message example with 'Subject: =?...?=' header to specify character set and byte encodings to protect non-ASCII characters in the email subject.

What Is "Subject: =?...?=" Email Header? "Subject: =?...?=" specifies that the email message subject is 7-bit encoded to protect non-ASCII characters. The encoded text uses the following format:

=?charset_encoding?byte_encoding?encoded-text?=

where: 
  charset_encoding = the character set encoding name, e.g. utf-8.
  byte_encoding    = the byte encoding ID, e.g. B (Base64) 
                     or Q (Quoted-Printable).

examples: 
  Subject: =?utf-8?Q?=E4=BD=A0=E5=A5=BD=EF=BC=81_-_Hello!?=
  Subject: =?utf-8?Q?=E4=BD=A0=E5=A5=BD=EF=BC=81?= - Hello!
  Subject: =?UTF-8?B?5L2g5aW977yBIC0gSGVsbG8h?=

For more information, see "RFC1342 - Representation of Non-ASCII Text in Internet Message Headers" at datatracker.ietf.org/doc/html/rfc1342

Here is a simple example of email message with a Quoted-Printable encoded text in the subject.

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
Subject: =?utf-8?Q?=E4=BD=A0=E5=A5=BD=EF=BC=81?= - Hello!

Can you read the Chinese characters in the "Subject" header?

Table of Contents

 About This Book

 Introduction to Email

 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

 Received: from ... by ... - SMTP Server Log

 References

 Full Version in PDF/EPUB