I'm having troubles with sending email.
Posted: Tue Jan 22, 2008 10:33 pm
I'm completely dumm in php, trying to send email directly from flash movie.
Flash form has 4 fields and code of flash is:
***** PLEASE USE THE
Code php is:
My hosting in yahoo, I've also created crossdomain.xml file. AND IT'S STILL NOT WORKING. Can anybody find an error? Thanks alot for your attention.
Flash form has 4 fields and code of flash is:
***** PLEASE USE THE
Code: Select all
TAG *****[/color]Code: Select all
enviar = function () {
if (email_txt.text.length && nombre_txt.length && titulo_txt.length && mensaje_txt.length) {
if (email_txt.text.indexOf("@") != -1 && email_txt.text.indexOf(".") != -1) {
form_lv = new LoadVars();
form_lv.nombre = nombre_txt.text;
form_lv.mail = email_txt.text;
form_lv.mensaje = mensaje_txt.text;
form_lv.titulo = titulo_txt.text;
form_lv.sendAndLoad("http://www.apsars.com/mail/send.php",form_lv,"POST");
mensaje_txt.text = "Enviando Mensaje..";
nombre_txt.text = "";
email_txt.text = "";
titulo_txt.text = "";
form_lv.onLoad = function() {
if (this.estatus == "ok") {
mensaje_txt.text = "Tu mensaje fue enviado...";
nombre_txt.text = "";
email_txt.text = "";
titulo_txt.text = "";
} else {
mensaje_txt.text = "Problemas con el servidornIntentalo de Nuevo";
}
};
} else {
email_txt.text = "Correo Invalido";
}
} else {
email_txt.text = "Dato Necesario";
nombre_txt.text = "Dato Necesario";
titulo_txt.text = "Dato Necesario";
mensaje_txt.text = "Dato Necesario";
}
};
borrar = function () {
nombre_txt.text = " ";
email_txt.text = " ";
mensaje_txt.text = " ";
titulo_txt.text = " ";
};
enviar_btn.onRelease = enviar;
borrar_btn.onRelease = borrar;Code: Select all
<?php
if(isset($_POST["nombre"]) && isset($_POST["titulo"]) isset($_POST["email"])
isset($_POST["mensaje"]) ){
$fecha = date("d-M-y H:i");
$mymail = "lisa@apsars.com";
$subject = "Desde el Sitio.. =)";
$contenido = $nombre." Escribio :\n";
$contenido .= $mensaje."\n\n";
$contenido .= "el mensaje se escribio el ".$fecha;
$header = "From:".$mail."\nReply-To:".$mail."\n";
$header .= "X-Mailer:PHP/".phpversion()."\n";
$header .= "Mime-Version: 1.0\n";
$header .= "Content-Type: text/plain";
mail($mymail, $subject, utf8_decode($contenido) ,$header);
echo "&estatus=ok&";
}
?>