Foros > PHP: Problema en Mail

  1. Eagletboy

    Mensajes [1] - Enviado el Sabado 02 de Junio de 2007 a las 18:33hs

    Hola soy nuevo aquí y me gustaría contar con vuestra ayuda para arreglar un código en php que me da error, LA FUNCION MAIL.

    Tengo una web en iespana y allí he creado un formulario donde un usuario, puede enviarme una sugerencia a mi correo electrónico. Para ello selecciona con un SELECT el correo a donde irá su sugerencia (gmail o yahoo), escribe su dirección propia de correo en un INPUT TEXT, y escribe en un TEXTAREA la sugerencia.
    Cuando pincha en "Enviar sugerencia", este formulario lleva la información recogida a una página llamada Cartero.php, que es la que tiene la función mail.

    Aquí os pongo los códigos del formulario y la página php, por si veis el fallo. Muchas gracias a las personas que respondan.









    Sugerencia.html
    [CODE]
    <html>

    <head>

    <style type="text/css">

    h5 {color:Red;font-family:Hartin2;text-align:center;font-size:20px;}

    td {color:black;text-align:center;font-weight:bold;}

    option {color:red;text-align:center;font-weight:bold;background-color:yellow;font-weight:bold;}

    b input {color:red;text-align:center;font-weight:bold;background-color:yellow;font-weight:bold;}
    textarea {color:red;text-align:center;font-weight:bold;background-color:yellow;font-weight:bold;}

    input {color:blue;text-align:center;font-weight:bold;}

    select {color:red;text-align:center;font-weight:bold;background-color:yellow;font-weight:bold;}
    </style>

    </head>

    <body bgcolor=#e78e35>

    <h5>Envia sugerencia</h5>


    <form name="cartografia" action="Cartero.php" method="POST">
    <center>
    <table width="300px" border="4px">
    <tr>
    <td>
    ¿Donde ira el correo?<br>
    <select name="receptor">
    <option value="xxx@gmail.com">Gmail</option>
    <option value="xxx@yahoo.es">Yahoo</option>
    </select>
    </td>
    </tr>
    <tr>
    <td>
    ¿Cual es tu correo?<br>
    <b><input type="text" name="emisor" size=40 value="@"></b>
    </td>
    </tr>
    <tr>
    <td>
    Escribe aqui tu mensaje o sugerencia:<br>
    <b><textarea name="sugerencia" cols=40 rows=8></textarea></b></br></br>
    <input type="submit" value="Enviar sugerencia"> <input type="reset" value="Limpiar">
    </td>
    </tr>
    </table>
    </center>
    </form>


    </body>

    </html>
    [/CODE]













    Cartero.php
    [CODE]
    <html>

    <head>
    <style type="text/css">
    a {color:red;text-align:left;font-weight:bold;background-color:yellow;font-weight:bold;}
    </style>
    </head>

    <body bgcolor=#e78e35>

    <?

    $destino=$_REQUEST["receptor"];
    $mensaje=$_REQUEST["sugerencia"];
    $remitente=$_REQUEST["emisor"];
    mail($destino,"SUGERENCIA TP",$mensaje,"From:$remitente") or die ("Su mensaje no se envio.");
    echo "<center><b>".$remitente." ha enviado a ".$destino." esta sugerencia: ".$mensaje.".";
    ?>
    <br><br>


    </body>
    </html>
    [/CODE]

  2. pako_mclr

    Mensajes [4] - Enviado el Viernes 27 de Julio de 2007 a las 19:19hs

    hola yo normalmente uso algo asi:
    pagina.html

    <html>
    <body><form method="post" action="send.php">
    <center><label>GUESTBOOK</label></center><br>

    Nombre :<br><input type="text" name="nombre" size="20" ><br>
    Correo Electronico destino<br>
    <input type="text" name="mail" size="30" ><br>
    Correo Electronico salida<br>
    <input type="text" name="sender" size="30"><br>

    Comentarios<br>
    <textarea name="comentarios" cols=50 rows=5>"Escribe aqu&iacute; tus comentarios"</textarea><br>
    <center><input type="submit" value="Enviar">
    &nbsp;&nbsp;&nbsp;<input type="reset" value="Restablecer" ></center>
    </form>
    </body>
    </html>


    send.php

    <?php
    $remitente = $_REQUEST["mail"];
    $mensaje = $_REQUEST["comentarios"];
    $sender=$_REQUEST["sender"];
    mail($sender, "Comentarios desde mi pagina",$mensaje, "From: $remitente")or die ("Su mensaje no se envio.");
    echo"tu mensaje fue enviado";
    ?>

    si te fijas no meto mas codigo en el archivo php no se si eso lo altere pero tambien puedes revisar tu archivo de configuracion de php
    espero que te sirva aunque ya es un poco tarde


responder

Para poder responder a este tema tenes que ingresar. Si no tenes una cuenta podes registrarse gratis..

publicidad

API DE FACEBOOK
GOOGLE CALENDAR API
GOOGLE MAPS API