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
how can i get this to work with cfmmail using coldfusion.
Email me at gc_extreme@hotmail.com
Hi Ed,
when i send the contact form, it just says sending….
but no mail send. Do i need to set any smtp server name in the sendmail.php or somewhere. Pls help
hello, when clicking the send button, it says “your message could not be sent. please try again.” why is this? before it used to just sit at the “sending…” process, but i put all files in the same folder as the html page and now it’s saying the message could not be sent quote. PLEASE HELP!
Hi.. hope somebody can help me :S
I did all the steps, but when i try to send an email from the website (form) , stays in sending….
what can be wrong?
Please help.. Thanks
I fixed the problem!
A lot of people are hosted at GoDaddy, but these scripts don’t work there.
I’m hosted at http://www.deleonhosting.com and they work perfectly!
I am recieving all the e-mails people send to me. To see what it looks like, click on the following link.
http://img94.imageshack.us/img94/1632/screenshotml.jpg
Best regards,
Ivar
Hello, my form is working but Turkish characters are receiving incorrect from swf form,
Name: Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?
Email: CC@CC.COM
Subject: Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?
Message: Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?Ä?
mail receiving like this,
can you help me
Engin
I used a similar email contact form, but it have a clean and nice look, here is the link:
http://www.gotelement.com/home/flash-scripts/141-flash-email-contact-form-as2.html
After days of troubleshooting, I finally realized the reason the form got stuck on “sending” was because I was using a preloaded to load the swf file. When I removed the preloader, the form works perfectly. My question if anyone has encountered this, is how can I use this form and still used my preloaded program? Could it just be changing the as in the fla to reflect this? or am I stuck building my own preloader.
I use SWF Lock & Load to load my flashsite.swf inside an html file.
Any thoughts?
Hi Rachel,
I’m struggling with exactly the same problem. Have you had any luck?
Thanks
Ardeaus,
I built a simple preloader at the beginning of my fla file and the form worked seamlessly. The problem definitely was having the external preloader load the fla file containing the form. Once I realized this I didn’t investigate why this is. Hope this helps.
http://www.vignettesphotography.com is the site I built and created my own preloader for, not as fancy as what SWF Load and Load can do, but it does the job and the form works.
Hello!,
when i send the contact form, it just says sending….
but no mail send. Do i need to set any smtp server name in the sendmail.php or somewhere.
Pleases can you help me!
Many thanks
The form is not working… Can anyone tell me if this problem is related to the SMTP authentication that does not exist?
Can anyone help me?
Thanks in advance!!!
Pedro
when i send the contact form, it just says sending….
but no mail send. Do i need to set any smtp server name in the sendmail.php or somewhere. Pls help
Hello, I’m getting everything people send me but the form never saids “your message have been sent” it gets stuck on “sending…”
I built my own preloader, so that’s not the problem.
Any solution?
Thank you.
Hello again!
I found the solution to the problem of the text being stuck on “sending…”. Go to the .fla file, and on the “send” frame change the following:
if( success == “yes” ) to: if( “success = yes” )
and:
else if( success == “no” ) to: else if( “success = no” )
And voila! It works
Hope this helps.
I get the form to work. ALMOST. after hitting the send button I still have not received any of my test emails. Im hosting on godaddy.
Take a look at the site http://hudsonsauce.com/beta.html
im using an email hosted on godaddy. I have tried using my yahoo email but still no delivery.