Ver Mensaje Individual
  #10 (permalink)  
Antiguo 01/03/2011, 04:22
w0rldart
 
Fecha de Ingreso: junio-2009
Ubicación: Madrid
Mensajes: 402
Antigüedad: 14 años, 10 meses
Puntos: 20
Respuesta: Enviar formulario a cuenta de correo

prueba con esto:

index.php
Código PHP:
<?php

$asunto 
$_POST['asunto']; 
$nombre $_POST['nombre']; 
$email $_POST['email']; 
$telefono $_POST['telefono']; 
$comentario $_POST['comentario']; 

$header 'From: ' $email " \r\n"
$header.= "X-Mailer: PHP/" phpversion() . " \r\n"
$header.= "Mime-Version: 1.0 \r\n"
$header.= "Content-Type: text/plain"

$mensaje "Este mensaje fue enviado por " $nombre " \r\n"
$mensaje.= "Su e-mail es: " $email " y telefono " $telefono "  \r\n"
$mensaje.= "Asunto: " $asunto " \r\n"
$mensaje.= "Comentario: " $comentario " \r\n"
$mensaje.= "Enviado el " date('d/m/Y'time()); 

$para '[email protected]';
$asunto 'Consulta desde cataja.org';

mail($para$asuntoutf8_decode($mensaje), $header); 

$location $_SERVER['SERVER_NAME'];
header("Location: " $location);
exit;

?>

<html>
    <body>
        <table width="680" border="1" cellpadding="10" cellspacing="0" bordercolor="#000000">
            <tr>
                <td height="206" align="center">
                    <form method="post" action="">
                        <table width="630" border="0" cellspacing="0" cellpadding="5">
                            <tr>
                                <td width="150"><strong>Asunto : </strong></td>
                                <td width="510"><input name="asunto" type="text" size="55" id="asunto" /></td>
                            </tr>
                            
                            <tr>
                                <td><strong>Nombre :</strong></td>
                                <td><input name="nombre" type="text" size="55" /></td>
                            </tr>
                            
                            <tr>
                                <td><strong>E-mail :</strong></td>
                                <td><input name="email" type="text" size="55" /></td>
                            </tr>
                            
                            <tr>
                                <td><strong>Telefono :</strong></td>
                                <td><input id="telefono" name="telefono" type="text" size="30" /></td>
                            </tr>
                            
                            <tr>
                                <td valign="top"><strong>Comentario :</strong></td>
                                <td><textarea id="comentario" name="comentario" cols="53" rows="3" ></textarea></td>
                            </tr>
                            
                            <tr>
                                <td>&nbsp;</td>
                                <td><input type="submit" name="send" value="Enviar" /></td>
                            </tr>    
                        </table>
                    </form>
                </td>
            </tr>
        </table>
    </body>
</html>