I am a novice at PHP, but I would like to create a simple form that sends to a single email upon Submit. I am running Apache and I don't get any errors, but I never receive my test emails? I press submit, and nothing. Can anybody tell me what I am doing wrong? Your help is greatly appreciated.
This is the code I have embedded in my contact_us.php file.
Name:
Email:
Message:
Separate file named sendmail.php.
<?php
$to = "j.crnjarich@comcast.net";
$email = $_REQUEST['email'] ;
$name = $_REQUEST['name'] ;
$subject = "Message from: $name";
$message = $_REQUEST['message'] ;
$headers = "noreply@YOURWEBSITE.com";
$body = "From: $name \n\n Email: $email \n\n Wesbite: $site \n\n Message: $message";
$sent = mail($to, $subject, $body, $headers) ;
if($sent)
{echo "";}
else
{echo "";}
?>