I created a contact form and want it to mail it to my e-mail. But when I try to use it nothing happens.
I've tried a demo e-mail code and that worked so I guess it's not a server problem.
The code:
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$phone=$_REQUEST['phone'];
$message=$_REQUEST['message'];
if (($name=="")||($email=="")||($phone=="")||($message==""))
{
$error = true;
}
else
{
$from="From: $name<$email><$phone>\r\nReturn-path: $email";
$subject="Contact";
mail("foo@hotmail.com", $subject, $message, $from);
$complete = true;
}
}
?>
PS: $complete
will become true
.