Tema: SMTP y mail
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 28/01/2004, 08:49
Avatar de maralbust@netsc
maralbust@netsc
 
Fecha de Ingreso: julio-2003
Ubicación: Santiago
Mensajes: 242
Antigüedad: 20 años, 9 meses
Puntos: 0
No se si te sirva, este es el que uso yo y si lo envia ( con el truco de que el correo exista o no exista funciona igual)


este es el codigo....
Código PHP:
<?
if (!$HTTP_POST_VARS){
?>
        </p>
        <form name="enviar" action="contacto.php" method="post">
  <div align="center">
    <br><br><br><table width="46%" border="0" cellpadding="0" cellspacing="0">
      <tr> 
        <td rowspan="2">Nombre:</td>
        <td><input type=text name="nombre" size=16></td>
      </tr>
      <tr> 
        <td><img src="archivos_index/spacer.gif" width="1" height="5"></td>
      </tr>
      <tr> 
        <td rowspan="2">Email:</td>
        <td><input type="text" name="email" size="16"></td>
      </tr>
      <tr> 
        <td><img src="archivos_index/spacer.gif" width="1" height="5"></td>
      </tr>
      <tr> 
        <td valign="top">Comentarios:</td>
        <td><textarea name=coment cols=32 rows=6></textarea></td>
      </tr>
    </table>
    <br>
            <br>
    <input type=submit value="Enviar" class="">
     <br><br>       <?
}else{
    
//Estoy recibiendo el formulario, compongo el cuerpo
    
$cuerpo "Formulario enviado\n";
    
$cuerpo .= "Nombre: " $HTTP_POST_VARS["nombre"] . "\n";
    
$cuerpo .= "Email: " $HTTP_POST_VARS["email"] . "\n";
    
$cuerpo .= "Comentarios: " $HTTP_POST_VARS["coment"] . "\n";

    
//mando el correo...
    
mail("[email protected]","Formulario recibido",$cuerpo);
    echo 
"<br><br><br><br>";
    
//doy las gracias por el envío
    
echo "Gracias por rellenar el formulario. Se ha enviado correctamente.";
}
    echo 
"<br><br>";
    echo 
"<input type='submit' value='Volver' onclick='window.history.back()'>";
?>

Saludos


..:: Bee-Freaks ::..
__________________
"La imaginacion es el limite"
bee-freaks