Foros del Web » Programando para Internet » PHP »

formulario

Estas en el tema de formulario en el foro de PHP en Foros del Web. hola chicos, a vuelta con el lio de formularios , aqui vengo conun error que me da el que he creado , os remito los ...
  #1 (permalink)  
Antiguo 24/08/2011, 09:38
 
Fecha de Ingreso: diciembre-2010
Ubicación: tenerife
Mensajes: 60
Antigüedad: 13 años, 4 meses
Puntos: 0
formulario

hola chicos, a vuelta con el lio de formularios , aqui vengo conun error que me da el que he creado , os remito los codigos a ver que es lo que le pasa, ( por cierto hice uno online , pero es que me gustaria hacerlo a mi )

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>

</head>

<body style="background-color:#00cc66"><table width="614" cellspacing="0" align="center" bgcolor="#009966">
<tr>
<th width="263" scope="col"><form method="POST"action="recibido1.php" >
<p>Nombre:&nbsp;&nbsp;
<input type="text" name="nombre" />
</p>
<p>
E-mail:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<input type="text" name="mail" />
</p>
<p>
Poblacion :
<input type="text" name="poblacion" />
</p>
<p>Telefono:&nbsp;&nbsp;
<input type="text" name="telefono" />
</p>
<p>
<input type="submit">
</p>
</form>
</th>
<th width="345" scope="col"><form id="form1" name="form1" method="post" action="">
<label for="mensaje">mensaje<br /></label>
<textarea name="mensaje" id="mensaje" cols="30" rows="10"></textarea>
</form></th>
</tr>
</table>


</body>
</html>

CODIGO PHP

<?php
echo " Nombre:". $_POST['nombre'];
echo "<br>";
echo "E-mail:". $_POST['mail'];
echo "Poblacion:".$_POST['poblacion'];
echo "Telefono:".$_POST['telefono'];

$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";

$mensaje = "Este mensaje fue enviado por " . $nombre . ", el conseguidor " . $empresa . " \r\n";
$mensaje .= "Su e-mail es: " . $mail . " \r\n";
$mensaje .= "Mensaje: " . $_POST['mensaje'] . " \r\n";
$mensaje .= "Enviado el " . date('d/m/Y', time());

$para = '[email protected]';
$asunto = 'Contacto desde el conseguidor';

mail($para, $asunto, utf8_decode($mensaje), $header);

echo '&mensaje enviado&';


?>

pero al comprobarlo en localhost me da este error , algo del smtp o algo asi ,

Nombre:
E-mail:Poblacion:Telefono:
Warning: mail() [function.mail]: Failed to connect to mailserver at "127.0.0.1" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\proyecto\recibido1.php on line 23
&mensaje enviado

gracias por vuestra ayuda
  #2 (permalink)  
Antiguo 24/08/2011, 09:44
 
Fecha de Ingreso: agosto-2011
Ubicación: DF
Mensajes: 44
Antigüedad: 12 años, 7 meses
Puntos: 10
Respuesta: formulario

en el php.ini tienes que des-comentar las lineas del SMTP asi:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = [email protected]
  #3 (permalink)  
Antiguo 24/08/2011, 10:03
 
Fecha de Ingreso: diciembre-2010
Ubicación: tenerife
Mensajes: 60
Antigüedad: 13 años, 4 meses
Puntos: 0
Respuesta: formulario

gracias por la respuesta a ver si entendi ,

cambio esto
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

por esto ??

; For Win32 only.
sendmail_from = [email protected]
smtp_port = 25

de momento tengo esto asi

; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost

Última edición por toyeslomao; 24/08/2011 a las 14:49

Etiquetas: html, formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:24.