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

Reply via email to