Solved

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

Posted on 2008-10-01
5
393 Views
Last Modified: 2013-12-17
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 :-(
0
Comment
Question by:designbyknight
  • 4
5 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 22617298
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
//----------------------------------------------
0
 

Author Comment

by:designbyknight
ID: 22617672
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 ???
0
 

Author Comment

by:designbyknight
ID: 22617753
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
0
 

Author Comment

by:designbyknight
ID: 22618162
Does it matter that the submit button is nested inside the form movie ?
0
 

Accepted Solution

by:
designbyknight earned 0 total points
ID: 22619404
okay new development
 i have now inserted another form...... this one appears to work except ...

it says the message was succesfully sent however i'm not actually receiving the email in my inbox
this is the new php script. could anyone tell where i'm going wrong as i really dont want another night without sleep.  code is as follows:-

<?

Error_Reporting(E_ALL & ~E_NOTICE);
$subject="from ".$_REQUEST['Your_Name:'] ;
$headers= "From: ".$_REQUEST['Your_Email:'] ."\n";
 $headers.='Content-type: text/html; charset=iso-8859-1';
 $message='';
  while ($field = current($_REQUEST)) {
        if ((key($_REQUEST)!="Your_Name:") && (key($_REQUEST)!="Your_Email:") && (key($_REQUEST)!="Message:") && (key($_REQUEST)!="i")) {
             $message.="<strong>".key($_REQUEST)."</strong>&nbsp;&nbsp;&nbsp;".$field."<br>";
      }
      next($_REQUEST);
 }
$message.="<br>".$_REQUEST['Message:'];
mail($_REQUEST['superdaveyk@hotmail.co.uk'], $subject,  "
<html>
<head>
 <title>Contact letter</title>
</head>
<body>
<br>
  ".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
      resizeTo(300, 300);

</script>
0

Featured Post

Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to Standardise Exchange Webmail email link? 6 58
<? versus <?php 5 37
Access Object's Property 9 22
mysql update statement effect only some rows 4 27
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
The viewer will learn how to count occurrences of each item in an array.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now