Re: How to enable UTF-8 Subject String ? Only Body is set ok
| From: | Bálint Horváth | Date: | Tue, 17 May 2011 15:12:51 +0000 |
| Subject: | Re: How to enable UTF-8 Subject String ? Only Body is set ok | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-312831@lists.php.net to get a copy of this message | ||
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@logodial.com>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@LogoDial.com_
>> Skype: _eliorr.com_
>>
>
>