<?php
$Name = Trim(stripslashes($_POST['Name']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));
$email_from = $Email;
$subject = 'Tienes un mensaje del sitio web';
$email_to = 'contacto@gidsa.com.mx';//replace with your email
// prepare email body text
$body = 'Name: ' . $Name . "\n\n" . 'Email: ' . $Email . "\n\n" . 'Message: ' . $Message . "\n\n";
$success = @mail($email_to, $subject, $body, 'From: <'.$email_from.'>');
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=gracias.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>