<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<title>Kontaktforumlar</title>
</head>
<body>
<?php
if(isset($_POST["mail"]) && is_array($_POST["mail"])) {
    if(empty(
$_POST["mail"]["to"])) {
        echo 
"<p>Kein Empfänger angegeben!</p>";
        
$fehler true;
    } else {
        
$header "From: ".$_POST["mail"]["from"];
        if(@
mail($_POST["mail"]["to"], $_POST["mail"]["subject"], $_POST["mail"]["message"], $header)) {
            echo 
"<p>Nachricht erfolgreich verschickt!</p>";
        } else {
            echo 
"<p>Nachricht konnte nicht verschickt werden!</p>";
            
$fehler true;
        }
    }
}
if(empty(
$_POST["mail"]) || isset($fehler)) {
?>
<form method="post" action="./kontakt.php">
    An: <input type="text" name="mail[to]" value="" /><br />
    Von: <input type="text" name="mail[from]" value="" /><br />
    Betreff: <input type="text" name="mail[subject]" value="" /><br />
    Nachricht: <textarea cols="40" rows="4" name="mail[message]"></textarea><br />
    <input type="submit" value="Absenden!" />
</form>
<?php
}
?>
</body>
</html>