When filling out the form it is saying sent successfully. So I need to enable or include phpmailer? The form is being sent via submit.php but the contact form is an html page. Do I also need to make the contact page php as well. Chmod permissions for submit.php is 755. In the script I do have the email address properly. I have phpmailer installed, do I need to activate it?
<?php
// specify your email here
$to = 'example@example.com';
// Assigning data from $_POST array to variables
if (isset($_POST['name'])) { $name = $_POST['name']; }
if (isset($_POST['email'])) { $from = $_POST['email']; }
if (isset($_POST['company'])) { $company = $_POST['company']; }
if (isset($_POST['message'])) { $message = $_POST['message']; }
// Construct subject of the email
$subject = 'Contact Inquery ' . $name;
// Construct email body
$body_message .= 'NAME: ' . $name . "\r\n\n";
$body_message .= 'EMAIL: ' . $from . "\r\n\n";
$body_message .= 'SUBJECT: ' . $company . "\r\n\n";
$body_message .= 'MESSAGE: ' . $message . "\r\n\n";
// Construct headers of the message
$headers = 'From: ' . $from . "\r\n";
$headers .= 'Reply-To: ' . $from . "\r\n";
$mail_sent = mail($to, $subject, $body_message, $headers);
if ($mail_sent == true) { ?>
<script language="javascript" type="text/javascript">
window.alert("Sent Successfuly.");
</script>
<?php } else { ?>
<script language="javascript" type="text/javascript">
window.alert("Error! Please Try Again Later.");
</script>
<?php
} // End else
?>