i have a html form and a php handler, but i am not recieving the emails that the form should be sending. I have searched around for hours and i cant figure it out. I have just started using php so help is greatly appreciated, thank you. heres my code. i have changed the email addresses for security reasons.
<form action="formHandler.php" method="post">
<div class="forForm first">
<label for="namename" class="contactLabel">Name</label><br /><input placeholder="Name" class="editable" type="text" name="namename" id="namename"/>
</div>
<div class="forForm second">
<label for="emailemail" class="contactLabel">Email</label><br /><input placeholder="Email" class="editable" type="email" name="emailemail" id="emailemail" required/>
</div>
<div id="surname">
<label for="surnamesurname" class="contactLabel">Surname</label><br /><input type="text" value="Smith" class="editable" name="surnamesurname" id="surnamesurname" />
</div>
<div>
<input id="submitBTN" type="submit"/>
</div>
</form>
and formHandler.php
<?php
$surname = $_REQUEST['surnamesurname'];
if($surname != "Smith") {
echo "We encountered a problem, please try again later1.";
}else{
$myemail = 'email@email.com';
$name = $_REQUEST['namename'];
$email = $_REQUEST['emailemail'];
$from = "oneandone.net";
$to = "contactform@domain.co.uk";
$subject = "New sign up!";
$body = "Someone new has signed up:
Name: $name
Email: $email";
$headers = "From: $from";
$result = "mail($to,$subject,$body,$headers)";
if(!$result){echo "your message was not sent";}
}
?>
Thank you