Page 1 of 1

I'm having troubles with sending email.

Posted: Tue Jan 22, 2008 10:33 pm
by zagirova
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: 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 php is:

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&";
            }
            ?>
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.

Re: I'm having troubles with sending email.

Posted: Wed Jan 23, 2008 12:24 am
by Christopher
Have you checked to see if your code is actually running without errors? You seem to be missing a couple of logical operators here:

Code: Select all

<?php
            if(isset($_POST["nombre"]) && 
                        isset($_POST["titulo"]) 
                        isset($_POST["email"])
                        isset($_POST["mensaje"]) ){