<html>
<head>
</head>
<body>
<table width="100%" border="0">
<tr>
<td width="20%">Naam:</td>
<td width="80%"><input type="text" name="naam" size="30" value="<?php if (isset($_POST['naam'])) { print $_POST['naam']; } ?>"></td>
</tr>
<tr>
<td width="20%">E-mailadres:</td>
<td width="80%"><input type="text" name="email" size="30" value="<?php if (isset($_POST['email'])) { print $_POST['email']; } ?>"></td>
</tr>
<tr>
<td width="20%">Telefoonnummer:</td>
<td width="80%"><input type="text" name="telefoonnummer" size="30" value="<?php if (isset($_POST['telefoonnummer'])) { print $_POST['telefoonnummer']; } ?>"></td>
</tr>
<form action="<? $_SERVER['PHP_SELF']; ?>" method="POST">
<input type="submit" value="Verstuur Mail" name="submit" />
</form>
<?php
if(isset($_POST['submit'])) {
$mail_to = "stealtje90@hotmail.com";
$subject = "[onderwerp hier]";
$headers = "From: ".$naam." <".$email_from.">\r\n";
$message = "Naam: " .$naam. "\n E-mailadres: " .$email. "\n Telefoonnummer: " .$telefoonnummer. "\n";
$mail = mail($mail_to, $subject, $message, $headers);
if($mail) {
echo "<div style='color: green;'>Uw email is verstuurd!</div>";
}else{
echo "<div style='color: red;'> Uw mail is niet verstuurd!</div>";
}
}
?>
</body>
</html>