Witam, mam jakze popularny problem: brak pl znakow przy otrzymywaniu maila wyslanego z formularza (przy obierzniu poczty przez przegladarke, przez no thunderbird wyswietla ok). PL znaki sa: w tytule, w imieniu i nazwisku, w adresie mailowym, ale w tresci nie ma..
KOD (kodowanie strony to UTF-8 (BEZ BOM)):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
....
<form name="form1" method="post" action="send_contact.php" style="float: left;">
<input name="subject" type="text" id="subject" style="width: 265px;">
<textarea name="detail" style="width: 260px;" rows="2" <input name="name" type="text" id="name" style="width: 265px;"> <input name="customer_mail" type="text" id="customer_mail" style="width: 265px;">
<input type="submit" name="Submit" value="Wyślij"> <input type="reset" name="Submit2" value="Wyczyść">
kod w pliku send_contact.php (kodowanie to UTF-8 (BEZ BOM)):
<?php
// Subject of the email
$subject = $_POST['subject'];
// Details/questions/messages
$message = $_POST['detail'];
// Name of sender
$name = $_POST['name'];
//email of sender
$mail_from = $_POST['customer_mail'];
//From
$header = "from: $name\r\n$name\n$mail_from";
$header .= "\nContent-type: text/plain; charset=utf-8\r\n";
// Email address
$to = "MOJ ADRES EMAIL";
$send_contact = mail($to, $subject, $message, $header);
if($send_contact)
header( 'Location: index.html' ) ; else
echo "ERROR: Your information has not been sent."; ?>
Nie wiem co jeszcze moge zrobic by pl znaki zaczely funkcjonowac. Prosze o pomoc.
Ten post edytował Seciu 29.02.2012, 17:53:53