Code: Zaznacz cały
<?php
if (count($_POST))
{
////////// USTAWIENIA //////////
$email = 'podalem moj mail'; // Adres e-mail adresata
$subject = 'temat'; // Temat listu
$message = 'Dziękujemy za wysłanie formularza'; // Komunikat
$error = 'Wystąpił błąd podczas wysyłania formularza'; // Komunikat błędu
$charset = 'utf-8'; // Strona kodowa
//////////////////////////////
$head =
"MIME-Version: 1.0\r\n" .
"Content-Type: text/plain; charset=$charset\r\n" .
"Content-Transfer-Encoding: 8bit";
$body = '';
foreach ($_POST as $name => $value)
{
if (is_array($value))
{
for ($i = 0; $i < count($value); $i++)
{
$body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value[$i]) : $value[$i]) . "\r\n";
}
}
else $body .= "$name=" . (get_magic_quotes_gpc() ? stripslashes($value) : $value) . "\r\n";
}
echo mail($email, "=?$charset?B?" . base64_encode($subject) . "?=", $body, $head) ? $message : $error;
}
else
{
?>
<form action="?" method="post">
<span id="textform">Name</span><input type="text" name="imie" size="50"style="padding:10px; margin-left:32px;"/><br/><br/><br/>
<span id="textform">Surname</span><input type="text" name="nazwisko" size="50" style="padding:10px;margin-left:10px;"/><br/>
<textarea cols="50px;" rows="10px;" style="margin-left:30px;margin-top:30px;">Please post your message here!</textarea>
<input type="submit" name="textarea" value="Send"/>
</form>
<?php
}
?>
Warning: mail() [<a href='function.mail'>function.mail</a>]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Program Files (x86)\VertrigoServ\www\form\index.php on line 28