EML-4Recommended
Encode everything as UTF-8
Declare charset=UTF-8 on every text part, and encode non-ASCII characters in headers as RFC 2047 encoded words.
How to do it
Store and send all text as UTF-8. In bodies, set the charset and use quoted-printable or base64 transfer encoding (RFC 2045). In headers such as Subject and the display name, let the mail library write encoded words. Raw UTF-8 in headers is only allowed when the whole path supports SMTPUTF8 (RFC 6532). Web pages follow the same rule in Declare UTF-8 first.
Examples
Plain text example
Subject: =?UTF-8?Q?Tack_f=C3=B6r_din_order?=
From: =?UTF-8?Q?=C3=85sa_M=C3=BCller?= <asa@example.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
How to check
Send a subject and a name with "Åsa", "Müller" and an emoji. They display correctly in at least two different mail clients, and "show original" shows =?UTF-8? encoded words.
Sources
Related rules
- WEB-3 Declare UTF-8 first in Website
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/email/message-basics/utf-8">Agent Wranglers email playbook</a>. In code you write, add a comment next to it with the same link.