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




have the simalar form with auto reply built into my website template.
everything is working fine the “sender” gets the auto reply… it says sent and clears the text fields. but i do not get the message myself???
not sure whats happening? no i’m not a dummy and didn’t input my address. haha
The form works fine, but don’t send non-latin characters. Is there a way to send it html/UTF-8 format?
Thanks in advance.
As Tan asked on:
“Tan // Jun 16, 2008 at 9:32 pm
Is it possible to change the actionscript to loadvariables from the php file located on another server, ie http://www.blahblah.com/send_email.php. How would i do this?”
I changed the send_emil.php?flashmo= to the full address http://www.siteitworkson.com/send_email.php?flashmo= but it does not work.
Security settings were mentioned. Can you explain a bit more?
I’ve gotten the contact form to work but now I’m wondering how to make a contact form that just grabs email addresses!
Like a email form that says “Get updates on our services! Enter your email below”
Does anyone know how to do that?
Admin,
Hello. The templates are great…one question, though.
I am working with Adobe Flash CS3, and using template 127 (flashmo curtain). I have gone to edit the “contact form” and pressed f9 to edit the action script, but cannot find:
$receiver = “youremail@yourdomain.comâ€
…can not find it anywhere in the script.
Am I looking in the correct place?
Thank you for any help.
Hi.
I am new to flash. I downloaded a premade template. I inserted the contact form in my new template. I edited the action script to replace my email at the $receiber.
When I preview the page it loads perfectly but it doesn’t let me put text in the fields. How can I fix this?
Is it possible for you guys to post a tutorial on how to edit the tempaltes and adding the scripts?
Excuse could someone please look over my PHP Process form? I keep getting parse errors and I’m new to PHP so it’s starting stress me now.
Here’s my code. And if you could e-mail me at:
info(at)mediagord.com with your reponse it would be a big help, I need this done pretty soon, thanks.
i m trying to use this code in my project . it works fine bt when i get mail in my id it looks like this
Name: abcd
Email: test@abcd.com
Subject: just chkng
hi im using this contac form on my website and it get’s stock on the sending…. part i dont know wy i check my web services and the say that the do support the PHP mailer son can you help me please!!!
Hey man! Thanks for sharing it!!!
Any idea how to add in drop down selection in flash form?
This is not working for me. I am also hosted through godaddy. I have bunch of files on my main directory index,1,2,3,4,5,6 – 6, is where the file is .mov clip is at. the PHP. is still under the send_email.php. When I downloaded the files they where on the desktop, now they are in the folder with the others. I changed the email address.Argg. Help!
How would I add the ability to upload a file to my email? I want to add this ability to add a file with a description with a check box (they have to check it to send).
hay i have the same sending problem. but i talked to godaddy and they said that i have to route the mail through there phpserver? i am confused he have me the address. any thoughts
hello! thanks for this form. just have one problem though. once i click on SEND, it sends the message, but the status is stuck to “sending…” and the form does not refresh like the demo here does. could this be a server issue?
any help will be appreciated. thanks.
Hi.,
I am trying to Your PHP Script but it’s comming “www.gmail.comphp” error message so please help me
Hi. The form is great, thanks for that. I wonder if you could help me. I modified slightly the form, added some input text field, named instances, modified actionScript accordingly. Now when I am trying to modify slightly PHP file, the form seem to be not working unless there is an exact statement: $firstname = $_POST['name'];. That works great but in the message body all the fields will have this ‘name’ entry and equal to the firstname input text. Thanks for your help in advance.
it works gr8 for me thanx very much!
Hi guys it was great to see such a support..
actually i m having problem in using the form whne i upload the swf file in another folder and php file in another one.
is ther a way to use the php file from flash in a different folder.
i have allready tried giving absolute path of php file in flash eg. http://www.blahblah.com/mailer.php
its not working cna somebody plz help me out…..thanks a tonn in advance
k I tried all the things that everyone has suggested. I tried setting the PHP.ini file to a correct smtp address instead of local host. I do infact get an error when trying to access the file directly, so I know php is working. but when I send I just get the send of death “by that I mean it never sends”.
I have also tried roberts php file and addapted to suit but still no go. I litterally want to cry!!!
Please help
it’s not working properly please tel me what is this
loadVariables(“send_email.php?flashmo=”
Mine is not working either…
Hosted with Godaddy (they support PHP).
Replaced the $receiver = “youremail@domain.com”; with my email address but it does not send..
Mine is not workin. I did everything and i got freeze on “sending”. And yes, my host supports PHP (godaddy.com). So? What is the problem?
same problem,
provider supports PHP5, but on “sending” i got freeze too.
Please, how to make it work on flashmo_092_restaurant template?
Hi Your template works fine when I use your files, but when I use it in my flash file it doesn’t work.
All settings are the same.
Hi! It’s very helpful and it works great!
So I tested it to my own email address and the email message included the text format like this –
Is there a way just to receive the name, email, and message? Thanks so much!!
“Name: juliane
min……”
Hi every body,
Fro the mail contact form some people have good because they can upload and use the contact form smoothly and some people they have no luck like me when i host this contact form in the linux server and i fill out the all the text box and then click send button. and the message (sending….)
and i do not see any sms more and i do not get any mail
Linux Server support PHP originally, do i need to upgrade….?
If u have any idea please advise me….
i will be welcome for your comments…
I’m download contact form all file but i cant open .FLA file. i’m using Flash 2004. are u doing it flash CS? please repley me.. this is very important me. Thank You
Hi sudesh, You need to have Flash 8 to open this contact form in AS2.
Hi.
I have a different problem. After clicking the send button in the swf i get the “your message was sent succesfuly” reply from the php file but the emails never arrive.
I have tried different email addresses and checked spam filters but nothing.
please help, thanks
The web address of the flash file is http://www.olliverphotography.com
thanks
This solution works for me when dealing with a flash template.
In flash website file flashmo_160, in your root folder where you have your .fla file, i will delete the index.html, and the .swf file. I will place the .php files here. Make sure there are no other .js files in this folder. then in adobe flash go to file/publish preview/html and you now get your new .js, .html, and .swf, i then upload all the files including the modified .php file with your email inserted in it and this works for me.
hey guys! i tested this example and when i receive the email, it’s all tagged like this:
I tried every solution i found on the net, still I can’t find the problem. Hope someone can give me a hand to sort it out.
Thanks!
in my previous post, the code I pasted isn’t shown. They are html tags, like: TEXTFORMATLEADING, FONT FACE, P ALIGN
Dear Admin:
I was looking through the posts and I see that nobody seems to know what the meaning of the “?flashmo=” in the loadVariables(”send_email.php?flashmo=” statement. Can you shed some light on this? Your help is greatly appreciated.
Thanks,
JohnM
Johnm,
?flashmo=” + random(1000) just putting a random value to refresh or call the send_email.php again and again submitting the form.
This is to avoid cache problem of just loading send_email.php once when submitting form repeatedly.
Sample values in submitting form repeatedly.
first time, send_email.php?flashmo=102
second time, send_email.php?flashmo=916
third time, send_email.php?flashmo=484
and so on…
Dear Admin:
Thanks for the explanation above, it clears another question I had re cache. On the “sending” subject, it is not working for me either. In my web page the message stays stuck on “Sending…”. I have tested sending messages using a PHP mailer and it works. I’ve also made sure that my “send_email.php” file is in the root of the server. What can be causing this? Maybe I am missing something. Well, I hope you can help me resolve this mystery.
JohnM
Hello Admin,
Any clues on my above question? I would really appreciate your input on this problem.
Thanks,
JohnM
Admin,
I have left you a couple of posts reference the contact form, but I have not heard from you. Are you answering users post anymore? Please advice.
JohnM
Hello JohnM,
You may adapt send_email.php scripts using PHP mailer. All html, php and swf files need to be on root folder, test them first and see if it works.
from where will i download the form
Hi ¡
I was working with bussisnes template 184 and the contact form.
I just want to tell to all that the contact form is working on this template ¡¡
I just need to ask to my host activate .php service and this works without problems.
Best regards
Having the same problem as everyone else. Im using godaddy to host and have made all the changes but getting the sending message always and nothing after. What to do??
For everyone use godaddy you must make sure your account is set to Linux
Thanks for
Bam // Jul 15, 2008 at 7:39 pm
I had the same problem eventually I went through this forum and follow the instruction which described by Bam I am glad its been solved
Thanks flashmo your template are very effective for me.
i´m using this form in my flash site an it works great, the only problem i got is with the characters “ç, á,à,â,ã”, they appear all wrong.
is there any solution to resolve this?
Thank you!
HELLO
The form works perfectly, I customized it adding more fields and it pass everything on my mail with no problem. Now I wat to add a radio button component to the form (question and 2 radio buttons – answer yes or no) and I don’t have a clue how to pass variables to PHP to make it work.
Can anyone help PLEASE
Thank You
Hi, so I am having a hard time getting it to work in my flash. Help please!