drupal_mail sending wrongly encoded special characters in mail subject I am using drupal_mail() function to send email. I have PHPMailer module with Mime Mail. It works perfectly, embedding images, sending HTML code, but for some reason, the subject line is pledged with bad characters, all the special chars of other languages do not display, a 'X' character display instead, but in the body of the message, it appears perfectly.

function mymodule_mail($key, &amp;$message, $params) {

    $message['headers']=array(
        'MIME-Version' =&gt; '1.0',
        'Content-Type' =&gt; 'text/html; charset=UTF-8; ',
        'Content-Transfer-Encoding' =&gt; '8bit',
        'Return-Path' =&gt; $params["from"],
        'Reply-To' =&gt; $params["from"],
There are no bugs. Maybe lazy code from the developers.

Just simply put this line

mb_encode_mimeheader($params["subject"],"UTF-8", "B", "\n");

for the subject and works in all languages and codifications (chinese, etc.). It is tremendous that phpMailer class in itself handles perfectly, but when you use the phpMailer module, this encapsulating dissapears and you have to hard-code in the mymodule_mail() function.

Sincerely, Drupal is not suited for big projects.