Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/05/2015, 17:55
jacko2003
 
Fecha de Ingreso: febrero-2008
Mensajes: 8
Antigüedad: 17 años, 1 mes
Puntos: 0
Respuesta: Método POST no envía datos

Al parecer es un error generado con el jQuery. Luego de hacer click en Send, se crea el Header para mostrar la notificación de que fué enviado.
He cambiado un poco la programación para que funcione, pero igual me gustaría que funcionara el header.
<?php

$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$phone = $_POST['phone'];
$company = $_POST['company'];

$email_from = $email_from = 'From: ' . $email . '' . "\r\n";
$email_to = '[email protected]';//replace with your email

$body = 'Name: ' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Subject: ' . $subject . "\n\n" . 'Message: ' . $message . "\n\n" . 'Phone: ' . $phone . "\n\n" . 'Company: ' . $company;

$mail_status = mail($email_to, $subject, $body, $email_from);

if ($mail_status) { ?>
<script language="javascript" type="text/javascript">
alert('Thank you for the message. We will contact you shortly.');
window.location = 'contact-us.html';
</script>
<?php
}
else { ?>
<script language="javascript" type="text/javascript">
alert('Message failed. Please, send an email to [email protected]');
window.location = 'contact-us.html';
</script>
<?php
}
?>