Mail From_name are unreadable characters. 2.6.1

Please report bugs here!

Moderator: Thorsten

Post Reply
UTAKA
Posts: 37
Joined: Sun Jan 24, 2010 8:01 am
Location: phpmyfaq-jp.org
Contact:

Mail From_name are unreadable characters. 2.6.1

Post by UTAKA »

Ex.
contact.html : Email to the webmaster

"Your Name" is No encoding ..
Chinese(Japanese/Korean..Multibyte String) characters in mail_From_name are garbage characters(unreadable characters) .

/inc/Mail.php Line435

Code: Select all

        // From
        foreach($this->_from as $address => $name) {
            $this->headers['From'] = (empty($name) ? '' : $name.' ').'<'.$address.'>';
        }
To

Code: Select all

       // From
        foreach($this->_from as $address => $name) {
			if(empty($name)){
				$this->headers['From'] ='';
			}else{
				if (function_exists('mb_encode_mimeheader')) {
					$name = mb_encode_mimeheader($name);
				} else {
					$name = encode_iso88591($name);
				}
			    $this->headers['From'] =  $name .' <'.$address.'>';
			}
//            $this->headers['From'] = (empty($name) ? '' : $name.' ').'<'.$address.'>';
        }
---------------------------------------
Sorry...I am not good at English.
http://www.phpmyfaq-jp.org
---------------------------------------
Thorsten
Posts: 15561
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Mail From_name are unreadable characters. 2.6.1

Post by Thorsten »

Hi,

thanks for the hint, I fixed it my git repo.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply