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

2011-05-17 Thread Andre Polykanine
Hello Eli,

  I'm using this code:

private function HeaderEncode ($str) {
// For the compatibility with PHP versions lower than 5.3.0
if (!function_exists ('quoted_printable_encode')) {
function quoted_printable_encode ($str) {
$res=str_replace ("+", "_", str_replace ("%", "=", urlencode($str)));
return $res;
}
}
$result='=?utf-8?Q?'.quoted_printable_encode($str).'?=';
return $result;
}

If  you  want  to  send  mail through an SMTP server, consider using a
class written by myself :-):
http://hkc.im/Y
The class is documented and ships with examples.

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion

 Original message 
From: Eli Orr (Office) 
To: php-general@lists.php.net
Date created: , 5:59:26 PM
Subject: [PHP] How to enable UTF-8 Subject String  ? Only Body is set ok


  
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_


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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

2011-05-17 Thread Bálint Horváth
Hi,
For the subject you can use sg. like this:



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) 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_
>>
>
>


[PHP] How to enable UTF-8 Subject String ? Only Body is set ok

2011-05-17 Thread Eli Orr (Office)

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_