tengo una web con un formulario de contacto y se ejecuta en un archivo que he nombrado "enviar.php" pero no puedo hacer el mail llegue al destino. (utilizo xampp)
les dejo el codigo fuente:
contacto.html
Código HTML:
<body> <form id="form1" name="form1" method="post" action="enviar.php"> <p>Nombre:<br /> <label> <input name="nombre" type="text" id="nombre" /> </label> <br /> Asunto:<br /> <input name="asunto" type="text" id="asunto" /> <br /> Email:<br /> <input name="email" type="text" id="email" /> <br /> Mensaje:<br /> <textarea name="mensaje" id="mensaje"></textarea> <br /> <label> <input type="submit" name="Submit" value="Enviar Formulario" /> </label> </p> </form> </body>
Código PHP:
<?php
$mail='[email protected]';
$nombre = $_POST['nombre'];
$asunto = $_POST['asunto'];
$email = $_POST['email'];
$mensaje = $_POST['mensaje'];
$message = "
nombre:".$nombre."
asunto:".$asunto."
email:".$email."
mensaje:".$mensaje."";
$headers = "From: [email protected]\r\n"; // te faltaba ésto.
if ( mail( $mail,'Recibiste un mensaje',$message,$headers) ) {
Header ("Location: contacto.html" );
die;
} else {
echo "no se envio";
die;
}
?>
Código:
y el minirelay me tira error y nunca los envia me sale lo siguite[mail function] ; For Win32 only. ; http://php.net/smtp SMTP = 127.0.0.1 ; http://php.net/smtp-port smtp_port = 25 ; For Win32 only. ; http://php.net/sendmail-from ;sendmail_from = postmaster@localhost ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ; http://php.net/sendmail-path ;sendmail_path = "\"\xampp\sendmail\sendmail.exe\" -t" ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename mail.add_x_header = Off ; Log all mail() calls including the full path of the script, line #, to address and headers ;mail.log = "\xampp\apache\logs\php_mail.log"
11:10:40 Escuchando en 127.0.0.1 (Puerto 25)
11:10:42 Comando: MAIL FROM <[email protected]>
11:10:42 Comando: RCPT TO <[email protected]>
11:10:42 [1] Dominio MX de gmail.com cacheado
11:10:42 [1] Conectando con gmail-smtp-in.l.google.com
11:10:48 [1] Error Connect timed out.
11:10:48 [1] Conectando con gmail-smtp-in.l.google.com
11:10:54 [1] Error Connect timed out.
11:10:54 [1] Conectando con gmail-smtp-in.l.google.com
11:11:00 [1] Error Connect timed out.
11:11:00 [1] Conectando con alt1.gmail-smtp-in.l.google.com
11:11:06 [1] Error Connect timed out.
11:11:06 [1] Conectando con alt1.gmail-smtp-in.l.google.com
11:11:12 [1] Error Connect timed out.
11:11:12 [1] Conectando con alt1.gmail-smtp-in.l.google.com
11:11:18 [1] Error Connect timed out.
11:11:18 [1] Conectando con alt2.gmail-smtp-in.l.google.com
11:11:24 [1] Error Connect timed out.
11:11:24 [1] Conectando con alt2.gmail-smtp-in.l.google.com
11:11:30 [1] Error Connect timed out.
11:11:30 [1] Conectando con alt2.gmail-smtp-in.l.google.com
11:11:36 [1] Error Connect timed out.
11:11:36 [1] Conectando con alt3.gmail-smtp-in.l.google.com
11:11:42 [1] Error Connect timed out.
11:11:42 [1] Conectando con alt3.gmail-smtp-in.l.google.com
11:11:48 [1] Error Connect timed out.
11:11:48 [1] Conectando con alt3.gmail-smtp-in.l.google.com
11:11:54 [1] Error Connect timed out.
11:11:54 [1] Conectando con alt4.gmail-smtp-in.l.google.com
11:12:00 [1] Error Connect timed out.
11:12:00 [1] Conectando con alt4.gmail-smtp-in.l.google.com
11:12:06 [1] Error Connect timed out.
11:12:06 [1] Conectando con alt4.gmail-smtp-in.l.google.com
11:12:12 [1] Error Connect timed out.
11:12:12 [1] ERROR: Se ha reintentado el envio 3 veces, devolviendo mensaje
11:12:12 [2] Devolviendo mensaje
11:12:12 [2] Dominio MX de gmail.com cacheado
11:12:12 [2] Conectando con gmail-smtp-in.l.google.com
11:12:19 [2] Error Connect timed out.
11:12:19 [2] Conectando con gmail-smtp-in.l.google.com
11:12:25 [2] Error Connect timed out.
11:12:25 [2] Conectando con gmail-smtp-in.l.google.com
11:12:31 [2] Error Connect timed out.
11:12:31 [2] Conectando con alt1.gmail-smtp-in.l.google.com
11:12:37 [2] Error Connect timed out.
11:12:37 [2] Conectando con alt1.gmail-smtp-in.l.google.com
11:12:43 [2] Error Connect timed out.
11:12:43 [2] Conectando con alt1.gmail-smtp-in.l.google.com
11:12:49 [2] Error Connect timed out.
11:12:49 [2] Conectando con alt2.gmail-smtp-in.l.google.com
11:12:55 [2] Error Connect timed out.
11:12:55 [2] Conectando con alt2.gmail-smtp-in.l.google.com
11:13:01 [2] Error Connect timed out.
11:13:01 [2] Conectando con alt2.gmail-smtp-in.l.google.com
11:13:07 [2] Error Connect timed out.
11:13:07 [2] Conectando con alt3.gmail-smtp-in.l.google.com
11:13:13 [2] Error Connect timed out.
11:13:13 [2] Conectando con alt3.gmail-smtp-in.l.google.com
11:13:19 [2] Error Connect timed out.
11:13:19 [2] Conectando con alt3.gmail-smtp-in.l.google.com
11:13:25 [2] Error Connect timed out.
11:13:25 [2] Conectando con alt4.gmail-smtp-in.l.google.com
11:13:31 [2] Error Connect timed out.
11:13:31 [2] Conectando con alt4.gmail-smtp-in.l.google.com
11:13:37 [2] Error Connect timed out.
11:13:37 [2] Conectando con alt4.gmail-smtp-in.l.google.com
11:13:43 [2] Error Connect timed out.
11:13:43 [2] El mensaje de error no ha podido ser enviado. Se queda en la cola
la cosa es que ya no secomo probar esto en mi computadora....
si alguien me puede tirar un salvavidas se los agradezco!!