Re: [thelist] PHP Mail and   ç é ê é

charles stuart javascript at enure.net
Thu May 5 19:34:23 CDT 2005


Thanks so much. 4 hours later I've gotten it. Not my most efficient 
day...

utf8_decode + charset=ISO-8859-1 did the trick.

It still doesn't look like the charset is making it through as a header 
properly. Hopefully I'll figure that out later.

Thank you all of your help. Much appreciated.




best,

Charles





On May 5, 2005, at 4:59 PM, Phil Turmel wrote:

> Charles,
>
> You're going backwards.....
>
> The original message has the characters encoded in UTF8, because your 
> form is using UTF8.  UTF8 encoding has already been done (that's why 
> special characters end up represented in two bytes).
>
> Also, your e-mail client is ignoring the charset specified by the 
> header, so you might want to consider using utf8_decode where you used 
> utf8_encode below.  Then specify charset=ISO-8859-1 in the email 
> headers.
>
> HTH,
>
> Phil
>
>
>
> charles stuart wrote:
>> Hi,
>> I've done my best to convert to UTF and then send the mail as UTF, 
>> still no luck. I'm obviously not doing this right.
>> The emailed text has changed to: Â Â ç é ê é
>> Thank you for any help.
>> best,
>> Charles
>> <?php
>> if ($_POST)
>>  {
>>     $name                     = 
>> stripslashes(strip_tags(utf8_encode($_POST['name'])));
>>     $email                     = 
>> stripslashes(strip_tags(utf8_encode($_POST['email'])));
>>     $text                      = 
>> stripslashes(strip_tags(utf8_encode($_POST['text'])));
>>         if ($name != "" && $email != ""  && $text != "")
>>         {
>>         $headers .= "Content-type: text/plain; charset=UTF-8" . 
>> "\r\n";
>>          $message = "$name ($email) has contacted you via the 
>> website.\n\n$text";
>>          mail("cs at enure.net", "Contact via the website", $message, 
>> "From: \"$name\"<$email>", $headers);
>>            echo "thanks";
>>             }
>>             }
>>         else
>>         {
>>         ?>
>>            <form action="<?= $PHP_SELF ?>" method="post" 
>> id="sendmail">
>>            </form>
>>              <?php
>>         }
>>         ?>
>> On May 5, 2005, at 2:48 PM, Jan Brasna wrote:
>>> Convert it to UTF and send the mail as UTF with appropriate headers.
>>>
>>> -- 
>>> Jan Brasna aka JohnyB :: www.alphanumeric.cz | www.janbrasna.com
>>> -- 
>>>
>>> * * Please support the community that supports you.  * *
>>> http://evolt.org/help_support_evolt/
>>>
>>> For unsubscribe and other options, including the Tip Harvester and 
>>> archives of thelist go to: http://lists.evolt.org Workers of the 
>>> Web, evolt !
>>>
> -- 
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester and 
> archives of thelist go to: http://lists.evolt.org Workers of the Web, 
> evolt !
>



More information about the thelist mailing list