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.
Código:
<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="[email protected]">Gmail</option> <option value="[email protected]">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>
Código:
<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>