Re: How to enable UTF-8 Subject String ? Only Body is set ok

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

 



Hi,
For the subject you can use sg. like this:

<?php

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);
}

?>

So first you have to try encode your string to set as subject.
Could be utf8_encode or base64_encode...

http://php.net/manual/en/function.utf8-encode.php
http://php.net/manual/en/function.mail.php

*Valentine*

On Tue, May 17, 2011 at 4:59 PM, Eli Orr (Office) <eli.orr@xxxxxxxxxxxx>wrote:
>
>> Hi,
>>
>> I'm trying to enable a whole Email as UTF-8 - The Body is OK but the
>> Subject remains ANSI - Please help
>>
>>  $headers = "From:$from". "\r\n" .
>>               "Reply-To:$from" . "\r\n" .
>>               "*Content-type:text/html;charset=utf-8;"*."\r\n" .
>>               "X-Mailer: PHP/".phpversion();
>>
>>
>>
>> --
>> Best Regards,
>>
>> *Eli Orr*
>> CTO & Founder
>> *LogoDial Ltd.*
>> M:+972-54-7379604
>> O:+972-74-703-2034
>> F: +972-77-3379604
>>
>> Plaut 10, Rehovot, Israel
>> Email: _Eli.Orr@xxxxxxxxxxxxx
>> Skype: _eliorr.com_
>>
>
>

[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