Agent Wranglers

Message basics Required

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).

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.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers email playbook: https://agentwranglers.se/playbook/email/message-basics/utf-8.