Basically this was working correctly a couple days ago and I tested it again on MAMP today and I'm no longer receiving the emails so mail() isn't firing? Please help.
This is my form in my index page
<form method="POST" action="form.php">
<label>Name</label>
<input name="name" placeholder="Full Name" required>
<label>Email</label>
<input name="email" type="email" placeholder="Email Address" required>
<label>Company</label>
<input name="company" type="text" placeholder="Your Company" required>
<input type="hidden" name="robots" value="" required/>
<input id="submit" name="submit" type="submit" value="Submit">
</form>
and this is my external form.php file
<?php
$name = mysql_real_escape_string(strip_tags($_POST['name']));
$email = mysql_real_escape_string(strip_tags($_POST['email']));
$company = mysql_real_escape_string(strip_tags($_POST['company']));
$robots = mysql_real_escape_string(strip_tags($_POST['robots']));
$from = 'From:RegisterForm';
$to = 'sofi.smith@blah.com';
$subject = 'Lead';
$body = "From: $name
E-Mail: $email
company: $company
";
if($_POST['submit']) {
if($robots == '') {
if (mail($to, $subject, $body, $from)) {
header('Location: thank-you-page.html');
} else {
echo '<p>Something went wrong, please try again</p>';
}
} else {
echo 'Sorry, we don\'t like spammers here!';
}
}
?><!doctype html>
<head>
<meta charset="UTF-8">
<title>Form</title>
</head>
<body>
</body>
</html>
Mamp php log shows no errors in the log apart from the depreciated element and when I remove this it makes no difference?