Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/02/2010, 12:54
martinelipsis
 
Fecha de Ingreso: febrero-2010
Mensajes: 5
Antigüedad: 14 años, 2 meses
Puntos: 0
Problemas con formularios PHP y Flash

Hola buenas tardes a todos, estoy iniciandome con el tema de desarrollo web particularmente en flash, he encontrado distintas trabas y hay una que me tiene muy complicado, el armado de un formulario flash y que se comunica con un php

SIEMPRE ME DEVUELVE QUE EL MAIL NO PUDO SER ENVIADO Y EFECTIVAMENTE NO LO ENVIA


el código es el siguiente:

Flash:

function enviar()
{
trace (t_nombre.text);
datos_email.nombre = t_nombre.text;
datos_email.ciudad = t_ciudad.text;
datos_email.email = t_email.text;
datos_email.tel = t_tel.text;
datos_email.texto = t_texto.htmlText;
datos_email.estado = "";
datos_email.onLoad = function ()
{
trace (this);
trace (this.estado);
if (this.estado == "enviado")
{
gotoAndStop(3);
t_nombre = "";
t_ciudad = "";
t_email = "";
t_tel = "";
t_texto = "";
}
else
{
gotoAndStop(4);
} // end else if
};
datos_email.sendAndLoad("enviar_email.php", datos_email, "post");
gotoAndStop(2);
} // End of the function
System.useCodepage = false;
if (datos_email == null)
{
datos_email = new LoadVars();
datos_email.nombre = "";
datos_email.ciudad = "";
datos_email.email = "";
datos_email.tel = "";
datos_email.texto = "";
datos_email.estado = "";
} // end if
t_nombre.text = datos_email.nombre;
t_ciudad.text = datos_email.ciudad;
t_email.text = datos_email.email;
t_tel.text = datos_email.tel;
t_texto.htmlText = datos_email.texto;
this.b_enviar.onPress = enviar;
stop ();


Codigo php


<?php

$destinatario="[email protected]";

//estos datos se usaran como cabecera del email.
$cabeceras="MIME-Version: 1.0\r\n";
$cabeceras .= "Content-type: text/html; charset=utf-8\r\n";
$cabeceras.="From: {$_POST['nombre']}<{$de}>\r\n";
$cabeceras.="Reply-To: {$_POST['email']}\r\n";
$cabeceras.="Reply-To: {$_POST['tel']}\r\n";
$cabeceras.="Reply-To: {$_POST['ciudad']}\r\n";
//el asunto del mensaje:
$asunto="Contacto de Pagina Web";
//El cuerpo del mensaje:
$cuerpo=' Ha recibido un E-mail de: <strong>'.$_POST['nombre'].'</strong>
<br />
<br />
E-mail: <strong>'.$_POST['email'].'</strong>
<br />
<br />
Telefono: <strong>'.$_POST['tel'].'</strong>
<br />
<br />
Ciudad: <strong>'.$_POST['ciudad'].'</strong>
<br />
<br />
Con el siguiente contenido:';
$cuerpo.='<br><strong>'.$_POST['texto'].'</strong><br>';
//la persona que envia el email.
$de=$_POST['email'];


if(mail($destinatario, $asunto, $cuerpo,$cabeceras)){
echo utf8_encode('&estado=enviado&');
}else{
echo utf8_encode('&estado=no_enviado&');
}

?>

Agradeceria cualquier tipo de ayuda