PHP Mail: Diacritics and Special Characters in Name and Subject are not displayed
Question by Guest | 2019-03-07 at 18:44
I'm just trying to send an e-mail with PHP's mail function. Everything works so well.
However, only as long as in the header of the mail there are no diacrits, umlauts or other special characters. As soon as I insert characters like Ä, Ö or É into the subject or the sender, they are no longer displayed correctly by my e-mail program.
Can someone tell me what I can do?
Related Topics
PHP: Sending an E-Mail
Tutorial | 0 Comments
PHP Mail Function: UTF-8 E-Mail Headers
Info | 0 Comments
PHP: Check Strings with Ctype-Functions for Character Classes
Article | 0 Comments
PHP: Remove arbitrary Characters at the Beginning and the End of a String
Tutorial | 0 Comments
PHP: Send Output of a Script by Mail
Tutorial | 0 Comments
Textarea Maxlength: Limit Maximum Number of Characters in Textarea
Tutorial | 3 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
Generally, the participating programs and servers only understand ASCII characters in the header of the e-mail. The letters from A to Z fall in this area, the diacrits, umlauts or a wide range of special characters not.
For this reason, you must separately encode the UTF-8 characters within the header:
Since this topic is more extensive, I wrote an article about the UTF-8 Header in the PHP-Mail function. In this article you will find an explanation of this line of code as well as a complete example of what a function might look like to prepare and send such a encoded mail.
2019-03-08 at 17:48