Hola, tengo el siguiente código para enviar los datos introducidos por un usuario a mi correo. El caso es que cuandos e envía no me pone ningún error pero no me llega el mensaje al correo. Qué parte está mal?
Cita:
Código HTML:
<form action="envio.php" method="post">
Asunto del mensaje: <select name="asunto">
<option value="sin_asunto">-- Elige un asunto --</option>
<option value="afiliar">Afiliacion</option>
<option value="sugerencia">Sugerencia</option>
<option value="aporte">Denuncia</option>
<option value="otro">Otro</option>
</select>
<br/><br/>Tu dirección email: <input name="remite" type="textbox"/>
<br/><br/>
<textarea name="texto" style="width:300px;height:230px;"></textarea>
<br /><br /><input value="Enviar" type="submit"/>
</form>
php
Código HTML:
<?php
$asunto = $_POST['asunto'];
$texto = $_POST['texto'];
$remite = $_POST['remite'];
$to = "[email protected]";
$header = "From: $remite";
if ($asunto=="sin_asunto" || $texto=="" || $remite=="")
echo "Rellena los datos requeridos correctamente. <a href='formulario.html'>Volver</a>";
else
{
mail($to,$asunto,$texto,$header);
echo "Mensaje enviado. <a href='index.html'>Regresar a MI WEB</a>";
}
?>
Saludos