// geef e-mail adres op van ontvanger
$mail_ontv = "stefan@wirelessbant.nl";
// als er niet op submit is gedrukt, of als er wel op is gedrukt maar niet alles ingevoerd is
if (!$_POST[submit] || $_POST[submit] && (!$_POST[naam] || !$_POST[mail] || !$_POST[msggs] || !$_POST[onderwerp]))
{
if ($_POST[submit] && (!$_POST[naam] || !$_POST[mail] || !$_POST[msggs] || !$_POST[onderwerp]))
{
echo "Je bent je naam, e-mail, onderwerp of bericht vergeten!
";
}
// form + tabel
echo "";
}
// versturen naar
else
{
// set datum
$datum = date("d.m.Y H:i");
// set ip
$ip = $REMOTE_ADDR;
$inhoud_mail = "===================================================\n";
$inhoud_mail .= "INGEVULD CONTACT FORMULIER\n";
$inhoud_mail .= "===================================================\n\n";
$inhoud_mail .= "Naam: $_POST[naam]\n";
$inhoud_mail .= "E-mail adres: $_POST[mail]\n";
$inhoud_mail .= "Bericht:\n";
$inhoud_mail .= "$_POST[msggs]\n\n";
$inhoud_mail .= "Verstuurd op $datum via het ip $ip\n\n";
$inhoud_mail .= "===================================================\n\n";
mail($mail_ontv, $_POST[onderwerp], $inhoud_mail, "From: $_POST[naam] <$_POST[mail]>");
echo "E-mail is verzonden. Bedankt voor uw reactie!";
}
?>