I am trying to send a message from an html-form to my email address.
This the html form:
- Code: Select all
<html>
<head>
<title>Mailformulier</title>
</head>
<body>
<form action="php/mailform.php" method="post">
<input type="hidden" name="to" value="houtkamp@localhost">
<input type="hidden" name="subject" value="mail van uw website">
<input type="hidden" name="redirect"
value=/webshop/www/thanks.html>
Naam: <input type="text" name="naam"><br>
E-mail: <input type="text" name="mailadres"><br>
Uw reactie: <textarea cols="30" rows="4" name="reactie"></textarea>
<input type="submit" value="verzenden">
</form>
</body>
</html>
I use this php script with it:
- Code: Select all
<?php
ini_set("SMTP", "localhost");
ini_set("smtp_port", 25);
ini_set ("sendmail_from", "houtkamp@localhost");
$to = $_POST["to"];
$subject = $_POST["subject"];
$redirect = $_POST["redirect"];
if (!$to) { // Bevat to geen waarde?
echo "U heeft geen ontvanger opgegeven!";
exit;
}
reset($_POST); // Zet de array pointer op 0, begin bij het begin
while($postvar = each($_POST)) {
$varnaam = $postvar['key'];
$varinhoud = $postvar['value'];
$boodschap .= $varnaam."=".$varinhoud."\n"; // Boodschap bevat
}
mail($to, $subject, $boodschap); // stuur de mail (aan, onderwerp, mail)
if (isset($redirect)) { // Bevat redirect een waarde?
header("location: $redirect");
}
?>
What do I have to change so I can receive an email, on this email address: houtkamp@localhost ?
I'd like to use Windows Live Mail. So Included in this question also lies the question for me:
What should the account settings be in this case?
I'm using this study book about PHP5 (the complete work). Because they warn you about not using
xampp life, I don't want internet connection.
Thank you in advance for your efforts in helping me out.
Yours truly,
Roy