Re: Mail subject encoding breaks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11 May 2009 at 18:25, Thodoris wrote:

Hi gang,
I am using phpmailer to send some mail notifications in an intranet I've made. This is a sample code:

$e->Subject = "This is δφκξγκδφη garbidge κηδφκξγσ";

Hi,

I have had success with this in the past:

$subject 	= "This is δφκξγκδφη garbidge κηδφκξγσ";	
$e->Subject	= mb_encode_mimeheader($subject, "UTF-8", "Q") ;

Regards

Ian

Thanks Ian this works in most cases but there are times that still breaks the subject. I have experimented with:

mb_encode_mimeheader($subject, "UTF-8", "B")

as well but nothing seems to be working without problems.

I think that this solved my problems since I noticed that it works fine until this moment.

function mail_utf8($to, $subject = '(No subject)', $message = '', $header = '') {
 $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n";
 mail($to, "=?UTF-8?B?".base64_encode($subject).'?=', $message, $header_ . $header);
}


--
Thodoris


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux