Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/12/2010, 10:13
Avatar de darklegend
darklegend
 
Fecha de Ingreso: diciembre-2010
Mensajes: 21
Antigüedad: 13 años, 4 meses
Puntos: 1
Respuesta: Problemas con email PHP-Flash

ola este el el codigo actionscript que deberias utilizar
enviar = function () {
if (email.text.length && asunto.length&&mensaje.length) {
if (email.text.indexOf("@") != -1 && email_txt.text.indexOf(".") != -1) {
var cbListener:Object = new Object();
// Assign function to Listener Object.
cbListener.change = function(event_obj:Object) {
trace("Value changed to: "+event_obj.target.selectedItem.label);
};
// Add Listener.
combo.addEventListener("change", cbListener);

form_lv = new LoadVars();
form_lv.email = email.text;
form_lv.mensaje = mensaje.text;
form_lv.asunto = asunto.text;

form_lv.sendAndLoad("send.php", form_lv, "POST");
servidor_txt.text = "Enviando Mensaje..";
asunto.text = "";
email.text = "";

form_lv.onLoad = function() {
if (this.estatus == "ok") {
servidor_txt.text = " Tu mensaje fue enviado...";
asunto.text = "";
email.text = "";
mensaje.text= "";
} else {
estado_txt.text = "Problemas con el servidor.";
}
};
} else {
email.text = "Correo Invalido";
}
} else {
email.text = "Dato Necesario";
asunto.text = "Dato Necesario";
mensaje.text = "Dato Necesario";
}
};
borrar = function () {
asunto.text ="";
email.text ="";
estado_txt.text ="";
};
enviar_btn.onRelease = enviar;
borrar_btn.onRelease = borrar;




el php se llama send.php





Código PHP:
Ver original
  1. <?php
  2. $asunto = $_POST['asunto'];
  3. $mail = $_POST['mail'];
  4.  
  5. $mensaje = $_POST['mensaje'];
  6.  
  7.  
  8. $header = 'From: ' . $mail . " \r\n";
  9. $header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
  10. $header .= "Mime-Version: 1.0 \r\n";
  11. $header .= "Content-Type: text/plain";
  12.  
  13. $mensaje  = "El asunto de este mensaje es: " . $asunto . " \r\n";
  14. $mensaje .= "Su e-mail es: " . $mail . " \r\n";
  15. $mensaje .= "Mensaje: " . $_POST['mensaje'] . " \r\n";
  16. $mensaje .= "Enviado el " . date('d/m/Y', time());
  17.  
  18. $asunto = 'Contacto entre php y flash';
  19.  
  20. mail($para, $asunto, utf8_decode($mensaje), $header);
  21.  
  22. echo '&estatus=ok&';
  23.  
  24. ?>
revisalo lo modique parecido al tuyo si tiene al gun error en las variables cambialo pero deberia funcionar un saludo y feliz año nuevo