Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/08/2002, 03:00
lcoll
 
Fecha de Ingreso: agosto-2002
Mensajes: 22
Antigüedad: 21 años, 8 meses
Puntos: 0
funcion mail() de php en Form Mail

buenos dias,
he ejecutado el codigo de Form Mail que dan en utilidades para el envio de emails y me pasa lo siguiente:(al final hay el codigo de form mail para que sirva de ayuda)
solo ejecutando el programa php poniendo su path en el URL, sin pulsar la tecla enviar del form, me sale en pantalla "gracias por su input" o bien "error".Lo que no entiendo es que me salga uno de estos mensajes antes de llamar a mail().
Segun yo tengo entendido la funcion mail() de php se ejecuta cuando submitimos un form, entonces allguien me puede explicar por que sucede esto? Me explico?
Form Mail:
<HTML><BODY BGCOLOR=FFFFFF>
<?php
$to = '[email protected]';
$from = '[email protected]';

//Check if we have something POSTed by the form.
if (isset($HTTP_POST_VARS)){
//Start with an empty body for the mail message
$body = '';
//Iterate through all the POSTed variables, and add them to the message body.
while (list($key, $value) = each($HTTP_POST_VARS)){
$body .= $key . ' = ' . $value . "
";
}
//Build up some nice From/Reply Headers
$headers = "From: $from
";
$headers .= "Reply-To: $from
";
//Mail the message out.
//Requires setting php3.ini sendmail path as per instructions
$success = mail($to, "Posted " . date("m/d/Y"), $body, $headers);
//Always check return codes from functions.
if ($success){
echo "<B><CENTER>Thank you for your input</CENTER></B>
";
}
else{
echo "<CENTER><B>Internal Error</B>: Your input was unprocessed.<BR>Contact $from</CENTER>
";
}
}
?>
<FORM ACTION=formmail.php METHOD=POST>
<INPUT NAME=sample><BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY></HTML>

me urge un poco
gracias
un saludo