| Recommend this page to a friend! |
| Packages of Michael Beck | Xoops 2.5 | htdocs/xoops_lib/vendor/phpmailer/phpmailer/SMTPUTF8.md | Download |
|
|||||||||||||||||||||
A short history of UTF-8 in emailBackgroundFor most of its existence, SMTP has been a 7-bit channel, only supporting US-ASCII characters. This has been a problem for many languages, especially those that use non-Latin scripts, and has led to the development of various workarounds. The first major improvement, introduced in 1994 in RFC 1652 and extended in 2011 in RFC 6152, was the addition of the From 1996, messages could support RFC 2047 encoding, which permitted inserting characters from any character set into header values (but not names), but only by encoding them in somewhat unreadable ways to allow them to survive passage through a 7-bit channel. An example with a subject of "Schrödinger's cat" would be:
Here the accented Similarly, 8-bit message bodies could be encoded using the same Domain names were originally also stuck in a 7-bit world, actually even more constrained to only a subset of the US-ASCII character set. But of course, many people want to have domains in their own language/script. Internationalized domain name (IDN) permitted this, using yet another complex encoding scheme called punycode, defined for domain names in 2003 in RFC 3492. This finally allowed the domain part (after the The one remaining part of email that could not handle UTF-8 is the local part of email addresses (the part before the I've only mentioned UTF-8 here, but most of these approaches also allowed other character sets that were popular, such as the ISO-8859 family. However, UTF-8 solves so many problems that these other character sets are gradually falling out of favour, as UTF-8 can support all languages. This patchwork of overlapping approaches has served us well, but we have to admit that it's a mess. SMTPUTF8
But there's a problem with this approach: adoption. If you send a UTF-8 message to a recipient whose mail server doesn't support this format, the sender has to somehow downgrade the message to make it survive a transition to 7-bit. This is a hard problem to solve, especially since there is no way to make a 7-bit system support UTF-8 in the local parts of addresses. This downgrade problem is what held up the adoption of The vast majority of large email providers (gmail, Yahoo, Microsoft, etc), mail servers (postfix, exim, IIS, etc), and mail clients (Apple Mail, Outlook, Thunderbird, etc) now all support SMTPUTF8, so the need for backward compatibility is no longer what it was. SMTPUTF8 in PHPMailerSeveral other PHP email libraries have implemented a halfway solution to This support is handled automatically: if you add an email address that requires UTF-8, PHPMailer will use UTF-8 for everything. If not, it will fall back to 7-bit and encode the message as necessary. The one place you will need to be careful is in the selection of the address validator. By default, PHPMailer uses PHP's built-in Postfix gotchaPostfix has supported |