Witam, mam problem z ustawieniem polskich znaków, w miejscu gdzie jest iso-8859-1 gdy wpisuje utf-8 mail w ogóle się nie wysyła i nie dochodzi na moją skrzynkę pocztową. Proszę o pomoc.
<?php
if(isset($_POST['submit']))
{
//The form has been submitted, prep a nice thank you message
$output = '<h1>Thanks for your file and message!</h1>';
//Set the form flag to no display (cheap way!)
$flags = 'style="display:none;"';
//Deal with the email
$to = '[email protected]';
$subject = 'a file for you';
$message = "<br>Imię:".strip_tags($_POST['imie']).""
."<br>Nazwisko:".strip_tags($_POST['nazwisko']).""
."<br>Nazwa fimry:".strip_tags($_POST['nazwa_firmy']).""
."<br>Kod pocztowy:".strip_tags($_POST['kod']).""
."<br>Miejscowość:".strip_tags($_POST['miejscowosc']).""
."<br>Telefon kontaktowy:".strip_tags($_POST['telefon']).""
."<br>Email:".strip_tags($_POST['email']).""
. "<br>Wiadomość:".strip_tags($_POST['message']);
$attachment = chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'])));
$filename = $_FILES['file']['name'];
$boundary =md5(date('r', time()));
$headers = "From: [email protected]\r\nReply-To: [email protected]";
$headers .= "\r\nMIME-Version: 1.0\r\nContent-Type: multipart/mixed; boundary=\"_1_$boundary\"";
$message="This is a multi-part message in MIME format.
--_1_$boundary
Content-Type: multipart/alternative; boundary=\"_2_$boundary\"
--_2_$boundary
Content-Type: text/plain; charset=\"iso-8859-1\"
Content-Transfer-Encoding: 7bit
$message
--_2_$boundary--
--_1_$boundary
Content-Type: application/octet-stream; name=\"$filename\"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--_1_$boundary--";
mail($to, $subject, $message, $headers);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>MailFile</title>
</head>
<body>
<?php echo $output; ?>
<form enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" <?php echo $flags;?>>
<p><label for="message">*Imię:</label> <input type="text" name="imie" id="imie" /></p>
<p><label for="message">*Nazwisko:</label> <input type="text" name="nazwisko" id="nazwisko" /></p>
<p><label for="message">Nazwa firmy:</label> <input type="text" name="nazwa_firmy" id="nazwa_firmy" /></p>
<p><label for="message">Kod pocztowy:</label> <input type="text" name="kod" id="kod" /></p>
<p><label for="message">*Miejscowość:</label> <input type="text" name="miejscowosc" id="miejscowosc" /></p>
<p><label for="message">*Telefon kontaktowy:</label> <input type="text" name="telefon" id="telefon" /></p>
<p><label for="message">*Adres e-mail:</label> <input type="text" name="email" id="emial" /></p>
<p><label for="message">*Potwierdź adres e-mail:</label> <input type="text" name="email2" id="email2" /></p>
<p><label for="message">*Wiadomość:</label> <textarea name="message" id="message" cols="20" rows="8"></textarea></p>
<p><label for="file">Zalacznik (max. 1MB):</label> <input type="file" name="file" id="file"></p>
<p><input type="submit" name="submit" id="submit" value="send"></p>
</form>
</body>
</html>