HERE IS THE CODE:
<form action="mail.php" method="post">
<input type="text" name="text">
<br />
<br />
<label>
<textarea name="textarea"></textarea>
<br />
</label>
<br />
<input type="submit" name="submit" value="Submit">
</form><br />
Code: Select all
$to = "trim9001@yahoo.com";
$subject = "Results from your Request Info form";
$headers = "From: My Site";
$forward = 0;
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting our form. We will get back to you as soon as possible.";
}Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\Apache Group\Apache2\htdocs\mail.php on line 39