Link to home
Start Free TrialLog in
Avatar of designbyknight
designbyknight

asked on

I keep getting undefined emails when i try to send my flash email form

Hiya all
  I'll start from the beggining then.
i have a website of the flash variety and inside the mian movvie i have got, nested, a form with which i want people to be able to email me information. The form is an example i downloaded off the web. Before i published my site to the server i uploaded this form.swf file and the related php file. I then visited the url, and filled ou the form and clicked send.... no problem and the form worked a treat ( i recieved the email). i then opened up my main.swf and scrolled across the timeline to the page in which i wanted to put this form.  I then created a new movie clipand copy and pasted the forms frames and action script into it. I then put this movie clip into the page where i wanted it. i then uploaded the main website onto my server along with the php file and now it doesn't work.   Phplease help !!!!  Here's the send button actionscript:-
on (release) {
      //      Now import the variables we
      //      need to send in this movie clip
      sender_mail = _root.Semail.text
      sender_name = _root.Sname.text
      sender_subject = _root.Ssubject.text
      sender_message = _root.Smessage.text
      //      all the vars we just imported
      //      will be sent via POST method now
      loadVariables("sendmail.php",this,"POST");
      //      and when receives the answer from
      //      the server...
      this.onData = function()
      {
            for(var a in this) trace([a,this[a]])
            //      ok, next frame
            _root.nextFrame();
            if(this.output=='sent')
            {
                  // in case of success
                  _root.errTitle = 'Thank You.';
                  _root.errType = "Your message has been succesfully sent.";
            } else {
                  //      else
                  _root.errTitle = "Error!";
                  _root.errType = "Attention, an error occurred while processing your message. Please try again later.";
            }
      }
}

.... and here is the php code:-

<?
if(!empty($HTTP_POST_VARS['sender_mail']) || !empty($HTTP_POST_VARS['sender_message']) || !empty($HTTP_POST_VARS['sender_subject']) || !empty($HTTP_POST_VARS['sender_name']))
{
      $to = "superdaveyk@hotmail.co.uk";
      $subject = stripslashes($HTTP_POST_VARS['sender_subject']);
      $body = stripslashes($HTTP_POST_VARS['sender_message']);
      $body .= "\n\n---------------------------\n";
      $body .= "Mail sent by: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail']  . ">\n";
      $header = "From: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
      $header .= "Reply-To: " . $HTTP_POST_VARS['sender_name'] . " <" . $HTTP_POST_VARS['sender_mail'] . ">\n";
      $header .= "X-Mailer: PHP/" . phpversion() . "\n";
      $header .= "X-Priority: 1";
      if(@mail($to, $subject, $body, $header))
      {
            echo "output=sent";
      } else {
            echo "output=error";
      }
} else {
      echo "output=error";
}
?>

Please help if you can....... things are getting pretty desperate now :-(
Avatar of Aneesh Chopra
Aneesh Chopra
Flag of India image

just replace following code:
//-------------------------------------
 sender_mail = _root.Semail.text
 sender_name = _root.Sname.text
 sender_subject = _root.Ssubject.text
 sender_message = _root.Smessage.text
//----------------------------------------------

replace above code with following:
//-------------------------------------
 sender_mail = this.Semail.text
 sender_name = this.Sname.text
 sender_subject = this.Ssubject.text
 sender_message = this.Smessage.text
//----------------------------------------------
Avatar of designbyknight
designbyknight

ASKER

Thanks for the rapid reply .. .... i tried this code change and now i don't get any emails at all !!!
     so i guess it's something to do with the script somewhere ... i thought it might have something to do with where the files are located on the remote server ???
My humblest apologies .... lack of sleep is making me halucinate

    the emails took a while to get there but they are still coming through as undefined ...even with this code change
  thanks in advance for your patience
Does it matter that the submit button is nested inside the form movie ?
ASKER CERTIFIED SOLUTION
Avatar of designbyknight
designbyknight

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial