How to recode sent messages to blessed UTF-8? The form handler sends to the mail messages of the form of the form of a message that seems to be a CP1252 encoding. I tried to solve the problem using the iconv function, but as a result I get only empty letters with no content at all.
<?php header("Content-Type: text/html; charset=utf-8");?> <?php $text=""; foreach($_POST as $key=>$val) { $text=$text." ".$key.":".$val." "; } //$text = iconv('utf-8', 'CP1252', $text); $title = "sendform" ; $to = 'xxx@yandex.ru'; $from='noreply@gyroshop'; if(mail($to, $title, $text, 'From:'.$from)) include("send.html"); ?>