WordPress.org

Make WordPress Core

Ticket #3658: mail.diff

File mail.diff, 606 bytes (added by warf, 7 years ago)

Quick patch which allows to send mail with UTF characters in Subject:

  • wp-includes/pluggable.php

    old new  
    162162                       "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n"; 
    163163       } 
    164164 
     165$preferences = array( 
     166   "input-charset" => "UTF-8", 
     167   "output-charset" => "UTF-8", 
     168   "line-length" => 1024, 
     169   "line-break-chars" => "\n" 
     170); 
     171 
     172$preferences["scheme"] = "Q"; 
     173$subject=iconv_mime_encode("Subject", $subject, $preferences); 
     174$subject=substr($subject, 9); 
     175 
    165176       return @mail($to, $subject, $message, $headers); 
    166177} 
    167178endif;