The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Solution of UTF-8 mail subject, hope add it in the next WordPress version (3 posts)

  1. Johnson.Wang
    Posted 7 years ago #

    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.

  2. sytoedov
    Posted 7 years ago #

    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.

  3. Franz Josef Kaiser
    Posted 7 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic