I'm trying to finish a project to help out a friend with his website and I can't get the contact form to work. When I hit send: it seems like it has sent but then nothing ends up in the inbox of the email address. (I can't even get Stackoverflow to work... keep getting a "your post appears to contain code that is not properly formatted as code")
Bellow is the website: pservices.comuf.com
Bellow is the PHP code:
<?php
// check if fields passed are empty
if(empty($_POST['name']) ||
empty($_POST['phone']) ||
empty($_POST['email']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$name = $_POST['name'];
$phone = $_POST['phone'];
$email_address = $_POST['email'];
$message = $_POST['message'];
// create email body and send it
$to = 'cgramsinjapan@hotmail.com'; // PUT YOUR EMAIL ADDRESS HERE
$email_subject = "P Services Contact Form: $name"; // EDIT THE EMAIL SUBJECT LINE HERE
$email_body = "You have received a new message from your website's contact form.
"."Here are the details:
Name: $name
Phone: $phone
Email: $email_address
Message:
$message";
$headers = "From: noreply@your-domain.com
";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
return true;
?>