Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/04/2016, 09:01
joseatm90
 
Fecha de Ingreso: diciembre-2012
Ubicación: Cáceres
Mensajes: 22
Antigüedad: 11 años, 4 meses
Puntos: 0
Envío formulario PHP

Buenas tengo una web aquí subida:

http://josecabrera.webcindario.com/
y aquí
http://josecabrera.esy.es/

Estoy haciendo pruebas para el envío del formulario y cuando voy a enviar el formulario me salta un mensaje de error que este...

Sorry José, it seems that my mail server is not responding. Please try again later!

Tengo el mismo error en las dos direcciones una es miarroba y otra hostinger, no sé que puede pasar... Gracias un saludo

Este es el código PHP, no sé que puede estar fallando...

Código PHP:
Ver original
  1. <?php
  2. // Check for empty fields
  3. if(empty($_POST['name'])        ||
  4.    empty($_POST['email'])       ||
  5.    empty($_POST['phone'])       ||
  6.    empty($_POST['message']) ||
  7.    !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
  8.    {
  9.     echo "No arguments Provided!";
  10.     return false;
  11.    }
  12.    
  13. $name = $_POST['name'];
  14. $email_address = $_POST['email'];
  15. $phone = $_POST['phone'];
  16. $message = $_POST['message'];
  17.    
  18. // Create the email and send the message
  19. $to = '[email protected]'; // Add your email address inbetween the '' replacing [email protected] - This is where the form will send a message to.
  20. $email_subject = "Website Contact Form:  $name";
  21. $email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message";
  22. $headers = "From: [email protected]\n"; // This is the email address the generated message will be from. We recommend using something like [email protected].
  23. $headers .= "Reply-To: $email_address";
  24. mail($to,$email_subject,$email_body,$headers);
  25. return true;           
  26. ?>