<?php
if(!$_POST) exit;
$to = 'email@email.com';
$name = $_POST['txtname'];
$email = $_POST['txtemail'];
$phone = $_POST['txtphone'];
$subject = 'Enquiry';
$comment = $_POST['txtenquiry'];
if(get_magic_quotes_gpc()) { $comment = stripslashes($comment); }
$e_subject = 'You\'ve been contacted by ' . $name . '.';
$msg = "You have been contacted by $name with regards to $subject.\r\n\n";
$msg .= "Phone No: $phone\r\n\n";
$msg .= "$comment\r\n\n";
$msg .= "You can contact $name via email, $email.\r\n\n";
$msg .= "-------------------------------------------------------------------------------------------\r\n";
if(@mail($address, $e_subject, $msg, "From: $email\r\nReturn-Path: $email\r\n"))
{
echo "<p class='ajax_success'>Thanks :)</p>";
}
else
{
echo "<p class='ajax_failure'>Sorry your message not sent, Try again Later.</p>";
}
?>