You've got three php tags and they're ending in very odd places, try this:
Code:<?php $field_name = $_POST['cf_name']; $field_phone = $_POST['cf_phone']; $field_email = $_POST['cf_email']; $field_message = $_POST['cf_message']; $mail_to = 'katie@rrc.la'; $subject = 'Message from RA website'; $body_message = 'From: '.$field_name."\n"; $body_message .= 'E-mail: '.$field_email."\n"; $body_message .= 'Message: '.$field_message; $headers = 'From: '.$field_email."\r\n"; $headers .= 'Reply-To: '.$field_email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); ?> <script type="text/javascript"> if (<?php $mail_status ?>) { alert('Thank you for the message. We will contact you shortly.'); window.location = 'contact.html'; } else { alert('Message failed. Please, send an email to katie@rrc.la'); window.location = 'contact.html'; } </script>



Reply With Quote
Bookmarks