";
}
else if ( ! preg_match("#[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})#", $email ) )
{
echo "Please enter a valid e-mail so I can contact you back.
";
}
else if (strlen($message) > 205)
{
echo "Only 200 words allowed.
";
}
else
{
$to = "ayelet.dekel@hotmail.com";
$title = "HaifaVacation - Contact by {$name}";
$body = "
New Contact Request
Name: {$name}
E-mail: {$email}
Phone: {$phone}
Message: {$message}";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "To: Dekel D. <{$to}>\r\n";
$headers .= "From: booking@HaifaVacation.co.il <{$email}>\r\n";
if ( mail( $to, $title, $body, $headers ) )
{
echo "The contact request has been submitted successfully!
";
}
else
{
echo "The mail could not be sent because of a server error.
";
}
}
}
?>
Message sent - Thanks for your enquiry
Please complete all fields correctly