[thelist] PHP Mail and   ç é ê é

Phil Turmel philip at turmel.org
Thu May 5 18:59:47 CDT 2005


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 !
>>
> 


More information about the thelist mailing list