AS2 Flash Contact Form
Here is a working example of flash contact form with simple validations using ActionScript 2 and PHP mail function. This flash email form can also immediately response back to you if the email was sent successfully or failed. You can easily copy the contact form movie clip and paste it into an empty frame of any flash template.
You need to replace below red line with your email address in send_email.php file.
$receiver = “youremail@yourdomain.com”;
If your web server does not support PHP, you will need to use any other supported server side language for mail function instead of using send_email.php file.
UPDATES (24 June 2008): Adding Email Auto Response in send_email.php file
- <?php
- $contact_name = $_POST[‘name’];
- $contact_email = $_POST[‘email’];
- $contact_subject = $_POST[’subject’];
- $contact_message = $_POST[‘message’];
- if( $contact_name == true )
- {
- $sender = $contact_email;
- $receiver = “youremail@yourdomain.com”;
- $client_ip = $_SERVER[‘REMOTE_ADDR’];
- $email_body = “Name: $contact_name \nEmail: $sender \nSubject: $contact_subject \nMessage: $contact_message \nIP: $client_ip \nFlash Contact Form provided by http://www.flashmo.com”;
- $email_body_auto_reply = “Hello $contact_name, \nThis is the auto reply message. Thank you. \nAdmin – http://www.flashmo.com”;
- $extra_auto_reply = “From: $receiver\r\n“ . “Reply-To: $receiver \r\n“ . “X-Mailer: PHP/” . phpversion();
- mail( $sender, “Auto Reply – Re: $subject”, $email_body_auto_reply, $extra_auto_reply ); // auto reply mail to sender
- {
- echo “success=yes”;
- }
- else
- {
- echo “success=no”;
- }
- }
- ?>
UPDATES (22 July 2008): Error correction in send_email.php file
Please change $subject to $contact_subject in line number 15.
Feel free to drop a comment if you have any question or feedback.
Related Post: Flash Contact Form in ActionScript 3









I like to have ” 2 reciever ” in a message,like
reciever1: email1yahoo.com
reciever2: email2yahoo.com
How to do this? Explane pls?
Hi there I have my mailform.php on a php enabled server which is different from where the website is served the served site server is not php, does both servers need to have php? another quick question would you need swf address to make flash contact forms work?
i’m testing this locally, not on a site. i’m using WAMPserver. i’m a senior in high school and i get most of this code, but when i put it in my server and run the html from my server it works, up until i click send, it says “sending” then says message could not send. i dont understand why it’s saying that… why isnt the message going through? i changed the $recipient in the php file to my email, but it doesnt go through. how can i fix this? i typed everything into the form correctly.
also there are a few bugs with this form. after i get the error that says cant be sent, if i delete anything, the message for example, then hit send, it displays “please insert all feilds” or “insert valid emial” depending on what i erased, for not even a secon. how can i make these longer so it isnt glitchy? or just make it stay at “insert all fields/valid email” without switching back to “cannot send”
hopefully you understand what i’m saying… it’s hard to explain.
great form and it works!! but what if I want to add a checkbox?
Thanks.
The autoresponder doesn´t work
I have downloaded the AS2 form an got it working successfully. I now want to add a number of extra Data Fields to it and they don’t seem to work in the PHP side.
The new input field is labeled ‘contact_more’ in the flash file and it all works ok but when I send it the new field is blank on the email recieved.
I have tried the following in the PHP but it doesn’t seem to want to input the text frome ‘Contact_more’. I was hoping for a solution to fix this:
Apologies.
Just goes to show you don’t need a long neck to be a goose.
I forgot to set the new field with a Variable’ name – d’oh.
All fixed. Sorry to trouble you.
Hi there, I followed the instruction, every thing is working fine, just when I try to send it gives me this massage:Error opening URL ‘file:///Macintosh%20HD/Users/edwardnahapetian/Desktop/Paros%20web%20site/send_email.php?flashmo=459′
Would you help me with this please, I do not know what to do.
Thanks Ed.
Thank you this worked a treat and I even modified it to fit the rest of the site – you are a life saver. Saved me heaps of work
THANK YOU SO MUCH FOR THIS !!! This form is amazing..it works perfect and this ended my 1,5 year search for a good but simple form.
thx again !!
reply to:
Ed Nahapetian says:
28 January 2010 at 4:36 am
Hi there, I followed the instruction, every thing is working fine, just when I try to send it gives me this massage:Error opening URL ‘file:///Macintosh%20HD/Users/edwardnahapetian/Desktop/Paros%20web%20site/send_email.php?flashmo=459?
Would you help me with this please, I do not know what to do.
Thanks Ed.
…………
you need to change the that path in your html file to the path it is on the server as