Been a few days since my last post but finally back to this problem.
As this is my first delv into PHP I'm finding it less than easy.
I've worn my Google keys out but still can't fix this.
If anyone can see a fault in my latest try !!!!!
As per SpywareDr I changed some entries to (I think) match the form and action_page, but no luck.
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$siteemailtosend="
jondoe@gmail.com";
$siteemailtoreceive="
jondoe@gmail.com";
if(empty($_POST['fname']) ||
empty($_POST['lname']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo nl2br ("\n\n We're really sorry, but the form doesn't seem to be working. ");
return false;
}
$fname = strip_tags(htmlspecialchars($_POST['fname']));
$lname = strip_tags(htmlspecialchars($_POST['lname']));
$email = strip_tags(htmlspecialchars($_POST['email']));
$phone = strip_tags(htmlspecialchars($_POST['phone']));
$message = strip_tags(htmlspecialchars($_POST['message']));
$to = $siteemailtoreceive;
$email_subject = "Website Contact From: $name";
$email_body = "You have received a new message from your website contact form.\n\r\n";
$email_body = $email_body."Here are the details:\n\r\n";
$email_body = $email_body."Name: $fname\n\r\n";
$email_body = $email_body."Last Name: $lname\n\r\n";
$email_body = $email_body."Email: $email\n\r\n";
$email_body = $email_body."Phone: $phone\n\r\n";
$email_body = $email_body."Message: $message\n\n\r\n";
$headers = "From: $siteemailtosend\n";
$headers .= "Reply-To: $email_address\n";
mail($to,$email_subject,$email_body,$headers);
return true;
if ((mail($to,$subject,$message,$headers))&&(mail($autoTo, "Thank You from Pine Lodge", $autoreply, 'From:
jondoe@gmail.com'))) {
header("Location: ".$goto_after_mail);
$success = "Your message has been sent. We shall reply as soon as we can";
}
?>