Használd ezt, nekem működik
PHP kód:
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-2' . "\r\n";
$headers .= "To: $to" . "\r\n";
$headers .= "From: thelol@azeletert.hu" . "\r\n";
mail($to, $subject, $message, $headers);
Function a karakterekért
PHP kód:
function char_utf8($string) {
if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string))
$string = preg_replace("/([\340-\357])([\200-\277])([\200-\277])/e","'<'.((ord('\\1')-224)*4096 + (ord('\\2')-128)*64 + (ord('\\3')-128)).'>'", $string); $string = preg_replace("/([\300-\337])([\200-\277])/e","'<'.((ord('\\1')-192)*64+(ord('\\2')-128)).'>'", $string); $replace_karakternorm_title = array('<233>' => 'é','<201>' => 'É','<195><169>' => 'é','<232>' => 'é','<xe9>' => 'é','<245>' => 'ő','<337>' => 'ő','<213>' => 'Ő','<336>' => 'Ő','<x0151>' => 'ő','<otilde>' => 'ő','<x151>' => 'ő','<369>' => 'ű','<251>' => 'ű','<219>' => 'Ű','<368>' => 'Ű','<252>' => 'ü','<220>' => 'Ü','<xfc>' => 'ü','<xed>' => 'í','<237>' => 'í','<205>' => 'Í','<239>' => 'i','<xe1>' => 'á','<225>' => 'á','<193>' => 'Á','<65533>' => 'á','<195><173>' => 'A','<250>' => 'ú','<218>' => 'Ú','<195><65533>' => 'ú','<371>' => 'u','<243>' => 'ó','<211>' => 'Ó','<195><179>' => 'ó','<195><161>' => 'ó','<xf3>' => 'ó','<214>' => 'Ö','<246>' => 'ö','<195><182>' => 'ö');
$string = strtr(($string), $replace_karakternorm_title); $trans_tbl1 = get_html_translation_table (HTML_ENTITIES);
foreach ( $trans_tbl1 as $ascii => $htmlentitie ) { $trans_tbl2[$ascii] = '<'.ord($ascii).'>'; }
$trans_tbl1 = array_flip ($trans_tbl1);
$trans_tbl2 = array_flip ($trans_tbl2);
$string = strtr (strtr ($string, $trans_tbl1), $trans_tbl2);
return $string;
}
Könyvjelzők