witam
mam formularz php mailto
i nie potrafie zrobic zeby ni wysylalo maila jezeli moje pola sa puste. abo jakiegos brakuje o to mj skrpt
<?php
if (count($_POST))
{
////////// USTAWIENIA //////////
$email = 'xxx@xx.xx'; // Adres e-mail adresata
$subject = 'Korespondencja xxx'; // Temat listu
$message = 'Thank You for Your letter'; // Komunikat
$error = 'An error occured during sending the e-mail. Pleas try again'; // Komunikat błędu
$charset = 'iso-8859-2'; // 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">
Name: <br><input type="text" name="Name" size="20"></textarea> <br>
Surname: <br><input type="text" name="Surname" size="20"></textarea> <br>
E-mail:<br><input type="text" name="E-mail" size="20"></textarea> <br>
Comemnts:<br><textarea name="Comments" cols="50" rows="4" wrap="physical"></textarea> <br>
<div id="dalej">
<input type="submit" name="ok" value="Send">
</div>