Sending E-mail through a Form Created in Flash?

I am new to Flash and have experienced several problems already. Now I have a new one. I created a Flash website and one of the pages has a contact form with Flash pushbutton components (Submit/Clear) in them. I know how to send form mail in regular HTML pages using CGI mailers, but how do you do it in Flash MX? Do I need PHP/ASP/MySQL or something? Can someone out ther please help

OK, I’ve never used CGI, but I’m pretty sure that you can send Flash variables to a CGI script. All you have to do is send the variables to the script. You can use either loadVars or loadVariables.

But if I were you, which I’m not, I’d do it with PHP. Lots of tutes out there, and very very easy. I think there’s a link in a very recent post.

pom :asian:

Here is a simple form structure using Flash and PHP,

on (release) {
if (sender_name eq “”) {
gotoAndStop (58);
} else if (sender_email eq “”) {
gotoAndStop (58);
} else if (sender_message eq “”) {
gotoAndStop (58);
} else {
getURL (“send_flash_form.php”, “”, “POST”);
}
}
// Checks to make sure the section is filled out and sends the variables you create to the php script

<?

// Copyright by filedesign.com 2001, 2002
// Information: Do not change the name of this file, it’ ill not work !

// Configuration of recipient and subject.
$recipient = "[email protected]";
$subject = “Contact Form”;

// Please do not change anything below this line!!!
// ________________________________________________

   $mailheaders = "From: &lt;$sender_email&gt; 

";
$mailheaders .= "Reply-To: <$sender_email>

";

   $msg = "_____________________________________________________________________

";
$msg .= "Sender’s Name: $sender_name
";
$msg .= "
";
$msg .= "Sender’s E-Mail: $sender_email
";
$msg .= "
";
$msg .= "Company: $sender_company
";
$msg .= "
";
$msg .= "Website: $sender_website
";
$msg .= "
";
$msg .= "Message:

$sender_message
";
$msg .= "
";
$msg .= “_____________________________________________________________________”;

   mail($recipient, $subject, $msg, $mailheaders) or die ("Couldn't send mail!");

?>

Hope this helps!

Hey Allen,
Maybe you should explain why you gotoAndStop(58) :slight_smile:

Hey Guys,

Thanks for the help. I really appreciate it. I’ve just never used PHP before. Anyone know where I could get a good Flash/PHP mail tutorial?

Thanks,

Kelly

try www.actionscript.org I found one there at it was really easy!

ilyaslamasse, sorry frame 58 was just a stop fram!
Actually i have redone the whole code, and if anyone would like the source for this (the FLA, PHP, SWF) i would be more than happy to give it to you.

I just finished this question forum

http://www.mxexhibits.com/

Just click on the Customer Satisfaction Form to see the final product