Recently I found out that the contact form on a site I designed had stopped working.
I researched it and saw the changes dreamhost had made.
To make a long story short, I've changed the from address to a dreamhost hosted email address, and I still can't get the emails to go through.
My code is below, what am I doing wrong? I need help with this ASAP.
//set the recipient email address, where to send emails to
$email_to = 'firstname.lastname@example.org';
//set the sender email address
$email_from = 'email@example.com';
$errors = '';
$errors .= "\n Error: all fields are required";
$name = $_POST['name'];
$email_address = $_POST['email'];
$title = $_POST['title'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$errors .= "\n Error: Invalid email address";
$to = $email_to;
$email_subject = "Media Request form submission: $name";
$email_body = "You have received a new message. ".
" Here are the details:\n name: $name \n email: $email_address \n title: $title \n address: $address \n city: $city \n state: $state \n zip: $zip";
$headers = "From: $email_from";
$headers .= "Reply-To: $email_address";
//redirect to the 'thank you' page
Prayer Request form handler