Support » Requests and Feedback » Solution of UTF-8 mail subject, hope add it in the next WordPress version

  • This problem is not exist in English environment, but exists in Unicode environment, especially in Asia like Chinese.

    All the wordpress works in UTF-8, including mail, but actually,it has been a problem when sending mail include Chinese words in subtitle, will getting garbage words.

    I have already a solution here. Every upgrade wordpress I will modify it again, so I hope this modification can be added in the next wordpress version. It doesn’t affect the English environment, but very helpful for Asia Unicode environment.

    wp-includes/pluggable.php :

    Line 361 (2.6.2) :

    Original :
    $phpmailer->Subject = $subject;

    Change to :
    $phpmailer->Subject = "=?UTF-8?B?".base64_encode($subject)."?=";

    This is the standard UTF-8 subtitle with Base64 encoding, you may check it out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thanks a lot for the solution.
    This stuff really drove me crazy.
    Installed latest and (not) greatest WP and… sending some mails it just fails.
    I was able to send message with title “Проверка” and was not able to send one with “Репка-жопка” (just an examples).

    Now it works for the both cases. whew!

    Thanks again.

    you should open a ticket and upload your patch to wordpress trac: https://core.trac.wordpress.org/ – you can use your wordpress-support-login (which you use over here) to login.

    i just did the same for wp_new_user_notification-function. worked perfectly: 3 people discussing, adding patch. done.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Solution of UTF-8 mail subject, hope add it in the next WordPress version’ is closed to new replies.