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


171 responses so far ↓
1 Dukes // May 29, 2008 at 10:02 pm
I have tried this form but I get stuck at the “sending….” message. Could you please help?
2 admin // May 29, 2008 at 10:12 pm
Dukes, you need to run it on your web server which supports PHP.
3 Dukes // May 29, 2008 at 10:33 pm
I am trying to run it from my web server and its not working. I looked at the actions for sending and it has “send_email.php?flashmo=” in the loadvariables. Do I need to change that to send_email.php?
4 Dukes // May 29, 2008 at 10:52 pm
What I am trying to do is put this on an existing fla I am working on
5 admin // May 30, 2008 at 9:58 am
Dukes, Did you also upload send_email.php to your web server? Are you sure that your web server can run PHP?
Please take a look at http://www.flashmo.com/preview/flashmo_104_circular which is integrated with this contact form. You will get an idea.
6 Editing Flash Templates // May 30, 2008 at 1:14 pm
[…] order to make the contact form in contact page to send to your email, please read this post. You may write a comment to this post if you have any […]
7 Dukes // May 30, 2008 at 8:44 pm
I found my error. I had my html page in one folder and .swf and php file in another folder When I put them in the same folder everything works. Thanks for this form
8 said // May 31, 2008 at 4:42 am
Hi there I would like to say big thank you now is working fine .
Many thanks
Regard
9 phpmailer // May 31, 2008 at 6:48 pm
Hi there,
im still having problems as featured above. It gets stuck on ’sending mail’. Ive even uploaded the default downloaded html, swf and php and just changed the email but still doesnt work.
Im running a php site on a linux server. So i shouldnt see a problem
Hope you can help
10 phpmailer // May 31, 2008 at 6:50 pm
found that when i press the ’send’ button twice, it then sends and i receive it.
Can this be sorted to only press once?
11 admin // May 31, 2008 at 7:18 pm
phpmailer, please PHP mail function if it works or not.
< ? mail("youremail@domain.com","Subject","Test","From Tester"); ?>
12 said // Jun 2, 2008 at 2:22 am
Hi Dukes i had the same Problem before so this flash form works fine what you need to do go and check with
your hosting Package if that sport the PHP method or not if not you have to update it .
Good luck
13 Claudiu // Jun 3, 2008 at 12:30 am
where is the download button?
14 admin // Jun 3, 2008 at 10:55 am
Download Source File link is located at the bottom of http://www.flashmo.com/preview/flashmo_102_contact_form
15 Max // Jun 10, 2008 at 3:03 am
THanks
works PERFECTLY !!!!!
all that i needed !!
u rock !!
16 arneberg // Jun 11, 2008 at 2:30 pm
This may sound like a stupid question for the experienced - but we all have to start somewhere :-)) :
Is there any way you can make this form work from a stand-alone Flash Player .exe-file that runs from a CD or does it only work when executed on the web?
17 admin // Jun 11, 2008 at 3:09 pm
arneberg, you may send the form variables to a mail client (e.g. Outlook) if it is on CD-ROM.
18 thebastion // Jun 11, 2008 at 10:49 pm
Hi there,
where can I find the the line to amend
$receiver = “youremail@yourdomain.com”;
in the fla file. I have looked at the action script code on the mail form section but cannot seem to find it.
I am using the floral template.
Many thanks
Stuart
19 admin // Jun 12, 2008 at 9:35 am
thebastion, please read it carefully again. That line is in send_email.php file, NOT the fla.
20 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?
Thanks
21 Aaron // Jun 16, 2008 at 10:32 pm
How do I edit the emailer in the flash websites…say for example file flashmo_079_classic.
22 admin // Jun 16, 2008 at 10:44 pm
Tan, it might be possible depending on security policies.
Aaron, just remove all keyframes at the last frame (which is the contact page) inside “flashmo contents” movie clip. And copy “contact form” movie clip from flashmo_102_contact_form.fla and paste it into any layer of the last frame in your “flashmo contents” movie clip of flashmo_079_classic.fla file.
23 Aaron // Jun 19, 2008 at 12:32 am
thanks, I have yet to give it a dry run but I followed your intructs to the tee…Looks good. I also need help in the area…how do I add my own additional..say photos and other objects like a download button for pre-prepared forms and “send to a friend” links to the scripts and links to other websites. I have no idea where I post those. It’s away from all your help thus far…but could you help me…
24 BGLdesign // Jun 19, 2008 at 12:41 am
This is just what I was looking for… Min Thu is the man!
Thanks,
BGLdesign
25 Arvie Morales // Jun 24, 2008 at 12:56 pm
Hello!
Thanks so much for this free email form. I am wondering though if it is possible to put an AUTO RESPONSE function in its PHP? I’d appreciate a quick reply. Thanks a lot and more power.
26 admin // Jun 24, 2008 at 4:17 pm
Arvie Morales,
Yes, it is possible to put auto response in PHP file. I have updated my post above for it.
27 Julie // Jun 27, 2008 at 3:17 am
Hi there… I am a n00b at this stuff. I am using the flashmo_052 design and on the contact page I would like to add this contact form. I tried to import it into the library but it won’t let me. What is the best way to put this form into the .fla I am workin on.
Thank you so much for your help. I did read through the comments but did not find my answer.
Thanks so much
28 Julie // Jun 28, 2008 at 12:23 am
Hi again. I copied your contact form from the library of another flash template of yours and pasted it on the contact page of flashmo_052. I had to embed the text in the text fields in order for that to work. Here is my result..
http://birdsongmarketing.com/2008.html view contact page. I have mt .php on my server in the same folder as the swf file. the emaill address I am using is for the server I have this on. Which is info@birdsongmarketing.com For some reason it acts like it sent because all the text cleared out plus it does not say sending or message sent. Not sure if I inserted the contact form correct or not into this .fla file.
Any help would be most appreciated.
29 Nikin // Jun 28, 2008 at 12:34 am
You Really Rock Macha
30 Aloonia // Jun 30, 2008 at 3:14 am
My host can run php. But when I have tried this form I get stuck at the “sending….” message like Dukes. What should I do ????
My site can run forum so it’s run Php contact form ?
31 Aaron // Jul 1, 2008 at 9:22 pm
if my server doesn’t support PHP, then what type of file extension do i use for the server side funtion posted at the top of this page
32 AMani // Jul 3, 2008 at 3:30 am
Hey my contact page seems to loop endlessly what could be the problem? Thanks in Advance.
33 Arvie Morales // Jul 4, 2008 at 4:21 pm
I have done everything but my message still stuck at “sending…” what’s wrong with this???
34 admin // Jul 4, 2008 at 4:58 pm
“sending…” is just because your web server does not support PHP or PHP mail function.
35 Arvie Morales // Jul 5, 2008 at 10:18 am
My server is yahoo. And according to them, they support PHP/PHP mail function.
36 Leo // Jul 5, 2008 at 8:35 pm
Hi,
I copied parts of the script and tried to integrate it with another flashmo template ( 074).
This is what i did, http://flash.pastebin.com/m101f379e
But i think the loadVariables() part is causing the trouble, as i can’t send the email with the above script, although the original fla works just fine. Can you please help?
37 admin // Jul 5, 2008 at 10:37 pm
Leo, I have looked at your codes. You cannot do like that way. Please follow steps in http://www.webdesignmo.com/blog/2008/05/26/as2-flash-contact-form/#comment-346
38 Kim // Jul 6, 2008 at 12:41 am
Hi,
I have inserted the contact form into my flash website but it is unclickable. The contact form is on a sub-page and it works fine if I just open that. But once I put the sub-page (with the contact form) into my main website, it becomes unclickable.
Appreciate the help!
39 sandeep kumar verma // Jul 7, 2008 at 2:54 pm
hello sir i am trying it into my site
40 Sergio // Jul 9, 2008 at 6:09 am
Ups, the Flash template is nowhere.
The link http://www.flashmo.com/download/flashmo_102_contact_form goes to a page with a link to the main page of flashmo.com
Mmm
41 Leo // Jul 10, 2008 at 9:03 pm
Hello,
I have got the contact form working. But the message_status field doesn’t seem to work. I always get “sending..” displayed.
The email is being sent, so the php script must be echoing success=yes, I do not understand why flash doesn’t use that var?
42 Bam // Jul 14, 2008 at 3:50 am
Does the PHP file has to be in the “cgi-bin” folder of my server or in the same folder as my swf file?
————–
I have it in both sections and can’t get pass “sending”.
——————
thanks
43 Bam // Jul 15, 2008 at 7:39 pm
I’m glad to say that the form finally works. I’m using it in the above flash template. Now I can move-on. For those of you who are haunted by the “sending” phenomenon, (as I was) try recopying the flashmo files into your server and the flash action script files and keep all files (html, swf, and send_email.php) in the root folder of your server (plublic_html). That’s what i did and it worked. Good luck and thanks to the administrator.
44 admin // Jul 15, 2008 at 9:11 pm
Bam, I am glad to know that your form works finally.
45 Despherado // Jul 17, 2008 at 4:40 am
I’m so so English.Please Turkish ??
46 Aaron // Jul 18, 2008 at 11:48 pm
can you tell me how I can change the auto response message in the original AS2 Contact form
47 edson principe // Jul 19, 2008 at 3:31 am
know you if hotmail support php ? Contact Form Flash does not work. The 4 files are in the same directory.I already changed ($receiver = “info@flashmo.com”;) in send_email.php
48 Aaron // Jul 20, 2008 at 2:44 pm
ANYONE! can you tell me how I can change the auto response message in the original AS2 Contact form. send an email to arebegees@gmail.com
49 Burntproduce // Jul 21, 2008 at 6:16 pm
I’ve noticed in both versions of the script (sans auto-reply and auto-reply) you forgot to add “contact_” to the $subject variable when setting up the mail function. These need to be changed from $subject to $contact_subject or else the subject on the form email and auto reply wont display the subject properly.
Thanks a million for this script. After a week of sheer frustration and 3 other scripts this is the first one i’ve used that seems to work properly!
50 admin // Jul 22, 2008 at 10:37 am
Burntproduce, Thank you for pointing me out about the mistake - $contact_subject variable. I have corrected above.
You are right that $subject variable will not work if the PHP variable register_global = off in PHP.ini settings.
51 Nesha // Jul 23, 2008 at 4:37 pm
Hi
Can you please help me figure out how this wud work? i did follow up all the instructions
changed the recive email address to mine in send php
when i upload the form to the server the form looks fine but when i fill in the form and click send it get stuck on “sending…” nothing happens after that. ” i am using my yahoo account address as the reciever email.
could you please guide me and explain to me how to it this form working.
hope to hear from you soon thnx
52 Nesha // Jul 23, 2008 at 5:02 pm
Hi Again,
just wanna to tel you i do get both messages to my emails
but when i submit the form it dosent say the message is been submit it just stays freezed on sending… and when i click few more times on the send button the sending… message dissapears but the form dosent clear out. it still stays freezed with the information typed.
could you please help me out with this. thnx
53 timmaeee // Jul 24, 2008 at 4:06 am
hey,
just curious… i’m currently trying to edit flash_079_classic template, and i can’t seem to edit the title, slogan, or copyright info. what do i do?
thanks, i’d appreciate a sorta fast reply
x
54 wes // Jul 29, 2008 at 2:21 am
hi,
I’ve got a quick question. The form is working fine for me, but I’d like to change one thing. The text that appears under the form telling the user to “please provide a valid email” or “sending” is always red. This color really clashes with the color scheme on my website. How can I change it to white?
55 Wojtas // Jul 30, 2008 at 12:04 am
Hi,I’ve a problem.When I click the SEND button I get an error “Your message couldn’t be send.Please try again.” Please help!!!
56 Juna // Aug 1, 2008 at 9:13 am
Hi!
First -Thanks for the form!
But I have the same problem as Nesha - form does not resets after I press “send” button.
After button is pressed again - the message dissapers But all info typed - stays in the form. I dont think it is the server. I do get emails from the form. (auto respond to!)
What could it be - anyone?
57 fernanda // Aug 7, 2008 at 8:17 am
Please, how to make it work on flashmo_092_restaurant template?
58 Jhay // Aug 13, 2008 at 12:08 pm
how can i get it to work on flashmo_081_design help please.
59 Flash Contact Form in ActionScript 3 // Aug 14, 2008 at 9:05 am
[…] contact form is simply made in Adobe Flash CS3 ActionScript 3. Email validation is better than previous version in ActionScript 2. It sends the form field variables to PHP and loads the response variables back to Flash using […]
60 Lance // Aug 20, 2008 at 10:53 pm
I cant download it. The “Download Source” link does nothing. Judging by other posts here, I’m not the first with this problem
61 Lance // Aug 20, 2008 at 10:54 pm
Can someone re-host the zip file for this? =)
62 Ugur // Aug 29, 2008 at 4:26 pm
Hi, Admin.
I edited template 118 fashion gallery and upload our host but I’ve been realized sadly to our host has not .php support.
Is there any way to solve this problem by AS, JS etc. ?
63 michael // Sep 3, 2008 at 7:35 am
hi, I cant get work this form, I uploaded all files, and change receiver for my mail adress but I cant receive the form in my mailbox, im using hotmail, but its not working, pd. Im using flashfomr for as2. please help.
64 michael // Sep 4, 2008 at 7:45 am
gr8t all done!! thx
65 Corey // Sep 6, 2008 at 1:25 pm
Greetings,
I’m not sure why admins stop giving assistance but it appears many of us are still having trouble. I accomplished everything I’ve wanted so far except putting this contact form on my existing fla. The fla is from flashmo and has an example set up but not ready to work.
So I download this, copy everything from the Library, Movie Explorer and Actions over to my fla or even a blank fla but NOTHING works.
I’ve uploaded this html, swf and email_php and it sends the e-mail fine. But I just CANNOT get it to transfer to my fla. I even created a new one and and made an exact copy of everything but still nothing.
Does anyone know if renaming the swfs and etc could effect it? I wouldn’t think so as long as the codes all pointed to the right files but I am stumped. ANY help what so ever would be appreciated. I’ve given assistance to others on this site, just hoping someone else can do the same…
Thanks
66 Saber // Sep 12, 2008 at 8:17 pm
Is there any way you can make this form work from a stand-alone Flash Player .exe-file that runs from a CD or does it only work when executed on the web?
I am quite new at this, would appreciate some assistance.
Many thanks
67 admin // Sep 13, 2008 at 10:44 am
Corey, I do not stop giving assistance. It is just that I do not get enough time to support everyone though I try to support as much as I can. I am really sorry about that.
Saber, I think it is possible by sending form fields data to Outlook or another email client for email.
68 Ugur // Sep 14, 2008 at 2:24 pm
hi admin!
will you answer my question up there?
69 curious // Sep 14, 2008 at 5:14 pm
Hi admin,
bigups for the wonderful works your are doing. I am trying to insert or import an intro template into a website template, all in flash , but this has not been easy. need help please
70 admin // Sep 14, 2008 at 6:13 pm
Ugur, there is no way to send email by AS or JS only. You need to have server-side mail processing scripts such as PHP, Perl, CGI, or ASP.
71 Saber // Sep 14, 2008 at 11:45 pm
Hello Admin,
I would appreciate it if you assist me with the script when you say sending form details to Outlook since I am very new to flash an am learning my way round.
Appreciate your time.
Many thanks
72 jolz // Sep 15, 2008 at 2:47 am
i’m having the same problem as the one reported above. I just see ’sending..’ and nothing else happens. i changed the html page housing my swf to *.php extension. What is the possible problem?
73 PHil // Sep 15, 2008 at 4:10 am
I am needing help with a contact page submit button directly to my email address? I am not understanding the flash php dual script. I have surfed around and found that the only thing is to put “on (release) ; { get to url(myemail) } but it does not work. I know it is simple however I am extremely lost on this piece. Please help
74 Roco bach // Sep 15, 2008 at 5:02 am
Hi there – Any Help would be appreciated
I can’t get this contact form to work at all. It just gets stuck on “sending…” It does not send at all
It says “sending…” and does nothing then hit Send again and the form just clears.
I have changed receiver to my email address
I’ve contacted my ISP and they say that they support php however the php file must be within a folder named cgi-bin- I’ve set permissions for “send_email.php” to 755 even 777 and tried placing it inside and outside the cgi-bin and nothing works. I also believe that the server is a linux server.
On reading the forum I see users gets results when all three files html,swf & send_email.php are within the same folder. This I’ve tried and again no luck however my ISP says that all .PHP must not be on the web space server only within the cgi-bin.
I’ve have even tried changing the path loadVariables(”send_email.php?flashmo=” + random(1000), this, “POST”); to loadVariables(”http://ccgi.username.plus.com/cgi-bin/send_email.php?flashmo=” + random(1000), this, “POST”);
Done all I can and no luck at all. Please help as I’m getting annoyed and about to give up.
Thank you
75 admin // Sep 15, 2008 at 8:19 am
Hello jolz and Roco bach,
Before you are making this flash form works, you need to make sure your web server supports PHP mail function by testing a simple mail script that sends email to your inbox. There are a lot of samples, just type “php mail” in Google and search.
76 admin // Sep 15, 2008 at 8:20 am
Hi PHil, you cannot send the flash form data directly into your email. You need to have a server-side script such as PHP, ASP, or JSP for mail processing.
77 jolz // Sep 15, 2008 at 3:43 pm
i have designed other sites running php on my laptop. I always test them and they always run. I will try to upload it online to my webhosts server and see if it runs just assuming d problem is with the php mail function
78 Roco bach // Sep 16, 2008 at 7:12 am
Run php mail test within cgi-bin on my server and all is working. It appears that the form has issues because the .php file is located within this cgi-bin folder even though persmissions are set to 755.
79 Roco bach // Sep 16, 2008 at 7:17 am
Is there anything that needs to be edited either within the action script in flash or .php file to make this form work being that the .php file is not located within the same folder as the html, swf. on our servers?
Thank you for your support
80 admin // Sep 16, 2008 at 7:49 am
jolz, some hosting does not allow php mail function. You will need to do extra mail setup using SMTP and phpMailer for that case.
Roco bach, I am not sure about CGI-BIN because I do not know anything about it. Sorry
81 Roco bach // Sep 16, 2008 at 11:16 pm
ADMIN – Thank you for your time and support which is gratefully appreciated.
BINGO! – I’ve managed to have this form working. It seems I had the same problem as user “BAM” being that our servers include a cgi-bin for .php files. I contacted my ISP and explained that all 3 files .html, .swf & .php must be in the root folder. They made some adjustment which was beyond my control - Whalla!
Question to “ADMIN” - My ISP explained to me after viewing the “send_email .php” script that this script is basic and open to abuse by hackers. By having such script open would jeopardise my account if subject to abuse. Could this script be updated so that it Hacker Proof?
I’m gutted – SERIOUSLY Gutted, I adore this Form, The best I’ve come across on the net, I’ve tried to get this form working for over a week and finally I’ve got it working, I’m told I run a 99.9% risk of being hacked. I’m so Hacked off.
I know nothing about PHP scripting. I wouldn’t know where to start to prevent being hacked.
Any advice or an updated hacked proof script would be much appreciated.
Again – Thank you for your support.
82 Mark // Sep 17, 2008 at 2:05 am
I’ve added this form onto my website but it only works if I change the html file to my index.html page.
I want to load this swf file into another swf file but doesn’t get passed sending… when I try it that way.
All of the files are in my root folder so the url’s should be fine.
What could be causing this problem?
83 Julie // Sep 24, 2008 at 3:07 am
Hi there. Is there any way that I can add an additional email address in the php file. so the email will go to two different emails???
And curious if there was any way..when it says message sent, can that stay on the form for alittle longer than it does???
thank you
Julie
84 admin // Sep 24, 2008 at 8:02 am
Julie,
Yes, you can do that in PHP file the following line…
$receiver = “youremail@yourdomain.com, secondmail@yourdomain.com”;
You can also make it a bit longer by increasing the number of frames.
85 Carlos B // Sep 26, 2008 at 3:51 am
Great stuff fella thanks!
Just a quick question… how hard would it be to send an attachment stored on the server with the email? i’ve currently got a form that uploads an image to the server and takes some user input, but i want to add the image as an attachment… any ideas?
Cheers
C
86 leigh // Oct 2, 2008 at 7:37 pm
I did a site for a client and he is now asking if he could recieve the email from the contact form in html format.
How do i do that. and is there a way that i can let the form send a copy of the message to the sender?
thanks
Leigh
87 dimitris // Oct 3, 2008 at 10:26 pm
my contact doesnt work….it say that it send it by the e mail doesnt come to my email…my server support php
88 Kayyali // Oct 13, 2008 at 4:36 am
Hey, nice work, but i have a issue like others, i can send mail to my Outlook mail ( info@mkayyali.com ) BUT my problem in sending a mail to Hotmail or Gmail accounts, can you help us on this ?
Thanks a lot
89 daniel // Oct 15, 2008 at 2:20 pm
hey
can someone help me
I cant get it working but i dont know if my server runs php
how can i instal it ? on my server
the mailfrom is stuck at sending…
tnx
90 pedro // Oct 19, 2008 at 9:09 am
Hi Admin
this form is great and runs perfectly!!
I’m now traiing your template 086 and didn’t find the send_email.php file. Do I need this file, or where can I change the $receiver script ?
All your templates are wonderfull and the best is the assitance you give us. Thank tou verry much!
91 walter // Oct 21, 2008 at 9:17 pm
Hi. I adopted your form for use inside a flash site I’m building. Everything works fine, except I receive garbage like this in the e-mail: Name: lkhj;lkj;lkj;lkj
92 walter // Oct 21, 2008 at 9:18 pm
wait, it did not show up here: “Name: lkhj;lkj;lkj;lkj “
93 walter // Oct 21, 2008 at 9:19 pm
To be short, i get each line in the email with a string of html tags. How can I fix it?
94 Flash Contact Form in ActionScript 3 | fatcityart // Oct 23, 2008 at 3:23 am
[…] contact form is simply made in Adobe Flash CS3 ActionScript 3. Email validation is better than previous version in ActionScript 2. It sends the form field variables to PHP and loads the response variables back to Flash using […]
95 chris // Nov 4, 2008 at 5:20 am
hi, i am using the contact form and placing it in a preexisting fla project, however, when i test the movie or publish it, it won’t allow me to input text into any of the fields
96 gastonix // Nov 4, 2008 at 7:18 am
hi there! i seem to have the same problem Kayyali has, if i submit an email adress at gmail or hotmail, an error message shows up and there’s no outgoing email, neither for the visitor nor for the webmaster… is there anyway to fix this problem?

thanx Admin for all your help!!
97 slider6902 // Nov 5, 2008 at 3:05 am
when trying this on my server it works great. But when i put it into my pre-existing FLA it does not. Any ideas? And yes my files are in the same location. and my server does support PHP. When i put this tutorial in a plain FLA it works, but in my site it does not.
98 slider6902 // Nov 6, 2008 at 4:08 am
Admin, I figured it out. Thank you for the tutorial, everything works perfectly. Was curious though if you knew how to send the user an email saying thank you and we will get back to you shortly. Or something similar.
I have attempted this and i’m having some issues. This is what i added before the closing PHP tag:
//send an auto response email to sender
if( $contact_name == true )
{
$sender = “myemail@mydomain.com”;
$receiver = $contact_email;
$email_body = “$contact_name \nThank you for your email. We will try our best to get back to you as soon as possible!\r\n\r\nSincerely,\r\nMy Name”;
$extra = “From: $sender\r\n” . “Reply-To: $sender \r\n” . “X-Mailer: PHP/” . phpversion();
if( mail( $receiver, “Wedding Site Email - $contact_subject”, $email_body, $extra ) )
{
echo “success=yes”;
}
else
{
echo “success=no”;
}
}
So this works, the only issue is that the site doesn’t say, “Your message was sent successfully!” (even though its working). Instead it gets stuck on, “Sending…”. If i delete the above if satement, everything works except the auto response. Any Ideas?
99 PaintedPony // Nov 7, 2008 at 8:09 am
Hello- I downloaded a template that has a contact form that looks like the one above. This is my first time so if you could help me figure this out that would be awesome. I can’t seem to find a send_email.php file anywhere. I was able to edit everything else I want on the template but this has me confused. I have not uploaded the site yet. THANKS!!!
100 miryam // Nov 13, 2008 at 6:48 am
and if I want to add a telephone tag?
101 turnock // Nov 17, 2008 at 10:49 pm
do you have an asp version of this code? My server supports asp but not php
102 chiara // Nov 20, 2008 at 6:06 pm
Dear administrator, I have a question: why in the SEND actions I cannot take away the FLASHMO word as shown below? If I do it, the form doesn’t work anymore
send_email.php?flashmo=
103 chiara // Nov 20, 2008 at 7:08 pm
sorry, I fixed it up.. I took out also the question mark symbol!!
104 jose // Nov 21, 2008 at 3:42 am
I’ve done everything you said i had to do but it doesn’t work. I gives the message that the mail wasn’t delivered.
105 The FOX // Nov 25, 2008 at 9:37 am
Works a treat…check out my version at
http://www.4reeldigitalart.com. I changed the fonts & color scheme to suit my site..It took all of 5 minutes to give it a make-over…(I might just change the red ’sending message’ text now that I know it works..10/10
Wonderful stuff OP.
The FOX
106 shiraz // Dec 1, 2008 at 4:10 am
is there a way that i can edit this and make like a reservation page using this contact form
107 Airton // Dec 4, 2008 at 4:32 am
Hello, I am Brazilian, excuse me for the mistakes of writing!
Because this form is not working on my jobs?
I can not understand!
108 Jurij Burkanov // Dec 9, 2008 at 6:42 am
This doesn’T work for me at all
I always get the message “Your message could not be sent. Please try again.”
I have unzipped the folder, then changed adress in .php file, saved and uploaded to my server (yes, it has php).
What could be wrong?
109 ewok // Dec 22, 2008 at 5:51 am
mine still says sending… i’ve done everything everyone says in this comments page,
i’ve updated everything it still gets stuck on sending…
when i publish it ni html
110 Ujjwal Agarwal // Dec 23, 2008 at 11:25 pm
Hello ..
I have been using this feedback form b4 as well .. not tat dumb wit flash i am .. but suddenly all the feedback forms tat i hav done or am oding arent working .. chk http://www.pencilatwork.com click on feedback .. it sends succefully .. but a mail is neva delivered .. i am really stuck .. http://www.pencilatwork.com/flashmo .. i uploaded the whole package .. just changed the email add in the php file .. still doesnt work . ??? urgent help needed ..
111 Robert // Dec 27, 2008 at 3:15 am
the form works…it says sent….but I do not get the mail at all……help…is the reciever line in the php file the ONLY line that needs to be modified or are thier others…
112 Sergio // Dec 30, 2008 at 12:23 am
We are using a server which doesn’t support PHP. How would we be able to use your contact form? Do you have an HTML file that will work?
113 Sergio // Dec 30, 2008 at 1:10 am
I worked a little and now I can run PHP on my server sooo scratch the one before xd, I just have one more problem… In the remote ADDR, should I be putting my IP adress?
114 Ujjwal Agarwal // Dec 30, 2008 at 8:14 pm
i have tried on 3 different servers man .. all support php .. all running heavy CMSs .. still the fucking thing doesnt work .. am in deep trouble over this guys . i am a designer .. i understand least of this codeing .. at least php n all .. plz lemme know if you find a solution ..
thanks in advance
And the thing is .. that it was working few months back all so perfect .. suddenly by itself it stopped ..
115 Ujjwal Agarwal // Dec 30, 2008 at 8:17 pm
may tat AC_RunActiveContent javascript file gotta do something wit it … is it?? tat looks like greek
116 Marie // Jan 4, 2009 at 9:37 pm
Is this free to use on business/commercial sites?
117 Robert // Jan 6, 2009 at 11:14 pm
Hi all,
First of all, I would like to say that this form is really cool. For those of us that are NOT programers, just designers…this helps alot.
Here is the two real problems that I and I assume most of the people on this forum are going to have is 1) That if the hosting server does allow PHP scripting…you may need to contact them to verify that the PHP extentions on thier end are turned ON. (this was the case with my ISP COMCAST…the support was there, just not enabled on thier end.) and 2) that the code does not allow for SMTP authentication…which is used by may servers that we host on..Mine is COMCAST (said with extreme hatered). These idots keep bouncing around the issue. I am NOT a programmer…so I have no idea how to itegrate thier SMTP sample code into the functioning code you have with this file… below is what my site looks like…the contact form script works, but does not recieve on my end…meaning the mail is never really sent..the script just SAYS it is…
Check out the site…so you can see what I mean.
http://www.fixitonsite.comcastbiz.net/
robert.downey@fixitonsite.comcastbiz.net
Now here is the sample they used to send a test mail to me…(which by the way how do you run a test, and what program or site would you use to do that):
<?php
require_once “Mail.php”;
$from = “Your Server “;
$to = “Robert Downey “;
$subject = “Hi Robert - Server Email Test!”;
$body = “Hi,\n\nHow are you? If you can see this the email script works.”;
$host = “smtp.jackiechantastic.com”;
$port = “587″;
$username = “test@jackiechantastic.com”;
$password = “test123″;
$headers = array (’From’ => $from,’To’ => $to,’Subject’ => $subject);
$smtp = Mail::factory(’smtp’,array (’host’ => $host,’port’ => $port,’auth’ => true,’username’ => $username,’password’ => $password));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail))
{
echo(”" . $mail->getMessage() . “”);
}
else
{
echo(”Message successfully sent!”);
}
?>
First off…what the hell is the require once mail_php or whatever mean…I have no file called that…
Second off…again how can this script example intergrate with you form to actually work…when I try using ANY variation of this with the original code (I have tried many)…the screen will just say sending…
that’s it.
HELP!!
118 Robert // Jan 7, 2009 at 11:45 pm
I got this working…for those of us out there that are NOT programers here is the final code that I am using without the auto reply (have add that still. AGAin I am on Comcast, so some of the in for like user name and pass on’t apply to you, but this is what it took to get the damned thing to work.:
<?php
require_once “Mail.php”;
$to = “Robert Downey “;
$message_name = $_POST[’name’];
$message_email = $_POST[’email’];
$contact_subject = $_POST[’subject’];
$contact_message = $_POST[’message’];
$host = “smtp.fixitonsite.comcastbiz.net”;
$port = “25″;
$username = “robert.downey@fixitonsite.comcastbiz.net”;
$password = “Darkside1″;
$headers = array (’From’ => $message_email,’To’ => $to,’Subject’ => $contact_subject); $smtp = Mail::factory(’smtp’,array (’host’ => $host,’port’ => $port,’auth’ => true,’username’ => $username,’password’ => $password));
$mail = $smtp->send($to, $headers, $contact_message);
if (PEAR::isError($mail))
{
echo(”" . $mail->getMessage() . “”);
}
else
{
echo(”Message successfully sent!”);
}
?>
As you can see it does look a little different from the original script. I took the contact form fields and renamed the first two (in flash action scripts, the button names, and the php…or this won’t work.), Then I placed the $to so that it will alwasy go to me…for the smtp mail factory you see that I had to add the smtp server name, username password AND port…this is a default port so it should work for you too….that or port 587……The only field that does not populate with this modified script is the messag_name field from the form. But I don’t care, I got the email address, suject and the message field working. The only error or problem I had is the action script that tells the user the message was sent still doesn’t work but I get messages, adn can reply back to them (I used 2 different accounts to test it and it works great…so I next went into the action script for the form and looked for the “sending…” message and changed it to say “your message was sent, please press CLEAR to reset the form. that was it…When I get the auto reply working I will place the code here to help out…
Check out what I have at
http://www.fixitonsite.net
119 George // Jan 9, 2009 at 8:07 pm
Hello!
I am trying to use this form and send text in Greek language but it does not work (we receive the text-email in unreadable characters). Is there a way to send it UTF-8 or ISO? Thank you.
120 Montrose // Jan 10, 2009 at 3:19 am
Hey there,
Thank you so much for this post. Like the others I am stuck on sending…. GoDaddy is hosting. They do support php and I have called in and it is activated on their end.. Any ideas of what could be happening???
121 Andrew // Jan 11, 2009 at 11:55 am
I am not getting any errors and I am not getting any emails. I get the confirmation that it was sent but no email. I am using php 4.0 with godaddy.com as my hosting. the example is here
http://www.kingdomleaders.org/contacts.html
(click “worship leader”)
Thanks for any help.
122 Andrew // Jan 12, 2009 at 9:42 am
UPDATE: I got the email 2 hours later so there was no problem with the script. I will try the auto-reply now.
123 AHMED // Jan 12, 2009 at 4:45 pm
Thanks everyone for this great tutorial
124 Robert // Jan 15, 2009 at 8:49 pm
hey guys here is the final code now that I got all fields to email (finally).
any way here it is. Also a side note. I had to set the $from AND the $to to MY email…as the comcast servers will think that I was trying to use thier servers to send another carrriers mail otherwise.. here you go…don’t forget to check the final product too.
http://www.fixitonsite.net
<?php
require_once “Mail.php”;
$from = “ADMIN “;
$to = “Robert Downey “;
$cc = $message_email;
$message_name = $_POST[’name’];
$message_email = $_POST[’email’];
$contact_subject = $_POST[’subject’];
$contact_message = $_POST[’message’];
$body = “Name: $message_name \nEmail: $message_email \nSubject: $contact_subject \nMessage: $contact_message \nIP: $client_ip”;
$extra = “From: $from\r\n” . “Reply-To: $message_email \r\n” . “X-Mailer: PHP/” . phpversion();
$host = “smtp.fixitonsite.comcastbiz.net”;
$port = “587″;
$username = “robert.downey@fixitonsite.comcastbiz.net”;
$password = “Darkside1″;
$headers = array (’From’ => $from,’To’ => $to,’Subject’ => $contact_subject,’Cc’ => $message_email);
$smtp = Mail::factory(’smtp’,array (’host’ => $host,’port’ => $port,’auth’ => true,’username’ => $username,’password’ => $password));
$mail = $smtp->send($to, $headers, $body, $extra);
if (PEAR::isError($mail))
{
echo(”" . $mail->getMessage() . “”);
}
else
{
echo(”Message successfully sent!”);
}
?>
125 Robert // Jan 15, 2009 at 8:50 pm
first 2 lines should read like this:
$from = “ADMIN “;
$to = “Robert Downey “;
126 Robert // Jan 15, 2009 at 8:53 pm
where the ADMIN is your email ex..
sample@emailaccount.com
make sure the admin address is in quotes…
email me at robertd0275@yahoo.com if you need the full send_mail.php if you are having trouble…
127 Robert // Jan 15, 2009 at 9:23 pm
here is my question…for some reason…the message will NOT clear after it is sent…so as a temp solution, I changed the sending…text to say Message sent.
the form does not clear unless I press the reset button…what does the action script need to say so that the message will read message sent, and then automatically clear regardless of whether the message WAS SENT!!…it seem the the AS2 script for the verify then clear..does not work for me SO i want to take it out…what can I change to do this?
128 Celia // Jan 20, 2009 at 4:19 pm
any1 figured how to fix the “sending” prob yet? I’m still stuck
129 Dazza // Jan 20, 2009 at 6:36 pm
I have done everything except throw my computer out the window to get the email working. 427, 000 times we have done what it says and still I get the same fault time and time again.
Error opening URL ‘file:///C|/Documents%20and%20Settings/Darren/My%20Documents/Flash%204/send_email.php?flashmo=981′
If this gets any more frustrating I’m gonna start plucking my eyebrows out! HELP!!!!!!!!
130 Jerry // Jan 22, 2009 at 7:19 pm
Hi,
First of thanks for this tutorial!!!
Do you have a tutorial for a guestbook without components with custom buttons and fields?
Thanks!
UROCK!
131 dave // Jan 22, 2009 at 7:25 pm
i keep geting this error what does it mean
Error opening URL ‘file:///F|/final%20year%20project/website/send_email.php961′
132 Jerry // Jan 22, 2009 at 7:29 pm
Dazza,
Don’t pluck out youre eyebrows!!!
The salt in youre sweat is going to hurt youre eyes!!! they do have a function you know!
It doesnt work because youre trying it locally (youre cpu) Youre gonna have to put it online for it to work. And check if youre webserver allows PHP scripting.
Put youre swf and youre published html + the sendEmail.php in the same directory on youre server, it wont work from youre cpu.
133 wearewill // Jan 29, 2009 at 9:39 pm
dear admin
firstly, big thanks for your work but can i ask you
how can i sure that my server support php or not please reply
134 Gonz // Feb 3, 2009 at 11:51 pm
I´m getting the message “you message coul not be sent. Please try again”. I uploaded the .html, the swf, and send_email.php, and it doens´t work. Please HELP…
135 Gonz // Feb 3, 2009 at 11:53 pm
I also change “youremail@yourdomain.com”. Any idea?
136 mentality // Feb 5, 2009 at 11:14 am
Script works fine except I have to hit the send button twice, client will not like this . Any fix?
137 Robert // Feb 10, 2009 at 9:40 pm
hey guys. GONZ, to run the PHP script by itself to test if your server TRULY supports php, all you need to do it go to the website that you published ..mine for example is http://www.fixitonsite.net….then put a forward slash / after the.net, and type in send_email.php…so it should look like this in my case:
http://www.fixitonsite.net/send_email.php
press enter…itf your server supports PHP, and you have changed the $recipeint = to your email address…it should give you a white screen that says…you message was sent successfully.
Check your email..you should have a blank message from yourself. that’s it.. Remember thought that some providers have not only the PHP but also SMTP authentication…like if you are hosting on COMCAST, COX, RoadRunner…etc. You will need to add lines to the PHP code for the SMTP authentication in that case. here is a heavily modified version of the original code for this form, it has the SMTP ion it…This form works perfectly…hit send once…that is it.
<?php
require_once “Mail.php”;
$from = “ADMIN “;
$to = “Robert Downey “;
$cc = $message_email;
$message_name = $_POST[’name’];
$message_email = $_POST[’email’];
$contact_subject = “New Mail From FIXITONSITE.net!!”;
$contact_message = $_POST[’message’];
$body = “Name: $message_name \nEmail: $message_email \nSubject: $contact_subject \nMessage: $contact_message \nIP: $client_ip”;
$extra = “From: $from\r\n” . “Reply-To: $message_email \r\n” . “X-Mailer: PHP/” . phpversion();
$host = “smtp.fixitonsite.comcastbiz.net”;
$port = “587″;
$username = “robert.downey@fixitonsite.comcastbiz.net”;
$password = “Darkside1″;
$headers = array (’From’ => $from,’To’ => $to,’Subject’ => $contact_subject,’Cc’ => $message_email);
$smtp = Mail::factory(’smtp’,array (’host’ => $host,’port’ => $port,’auth’ => true,’username’ => $username,’password’ => $password));
$mail = $smtp->send($to, $headers, $body, $extra);
if (PEAR::isError($mail))
{
echo(”" . $mail->getMessage() . “”);
}
else
{
echo(”Message successfully sent!”);
}
?>
138 Robert // Feb 10, 2009 at 9:51 pm
the auto reply is not supported in my version of php from my host…but the way this is written now…thier email info is also placed in the Cc field of the email I get…so I can reply to all and send them mail..also the body contains thier nam , email, and messge subject, and message body.
the $from= is ADMIN…which is set to
robert.downey@fixitonsite.comcastbiz.net placed in or:
ADMIN
there MUST be a space between the ADMIN and the first <…all of it should be inside one set of “”
the $to= is set to my email as well…so basically..I am sending a message to myself. Most hosts will BLOCK a message if the $from is set to the form’s email field address. This is because the host thinks that someone is trying to use your account to send out spams. by setting them BOTh to the same address manually. the Host doesn’t care.
As I said the code works…email me if you want the actual PHP file that I showed here. Ican help you set it up the way you need it. I also redesigned the form itself so that it is animated..which is cool as hell go look at my site and try it yourself.
My email is RobertD0275@yahoo.com for fastest resonse. Any of you needing help can send me a message there.
Hope this helps
139 Grek // Feb 17, 2009 at 8:00 am
Hi all,
I sent message then I’ll try to send again but When I click the SEND button I get an error “Your message couldn’t be send.Please try again.” Any idea?
and
loadVariables(”send_email.php?flashmo=” + random(1000), this, “POST”);
in this code what does 1000 means? do i need to change?
Thanks a lot…
Grek
140 plash // Feb 24, 2009 at 7:18 am
not delivered help me admin
141 plash // Feb 24, 2009 at 6:38 pm
some body help me
sending. . .
after try again
your message send
but in fact its not delivered
why? help me
142 Robert // Feb 25, 2009 at 10:45 pm
plush…it sounds like your server or host server i should say…is not letting the php script run…or it is not supported…
If it is supported…call your host and ask them to verify that the php server extentions for your site are enabled…the same thing happened to me and it turned out that they forgot to enable the feature on my account…after that it worked fine… email me at RobertD0275@yahoo.com and I can send you a test.php file that you can upload to your server or host…then all you need to do is type in a browser (for example)
http://www.fixitonsite.net/test.php
hit enter and if your host supports the PHP extention…it will say message was sent, and your email should have a blank message from your site…NO one ever told me these little tricks, had to learn it the hard way..
143 reza // Mar 3, 2009 at 5:33 pm
i have put swf,html,php form in the same directory in the server and php server scripting s on also.but the send form still doesn’t work.
i am gonna kill this computer
good computer is a dead computer
144 Bill Cole // Mar 4, 2009 at 11:47 am
To all -
After three days of tryng to figure this out, I got mine to work. And because I’m a God fearing man, I’m going to share with the rest of the class.
First, if you’re like me you were unsure if your mail server was able to take PHP. Install PHP on your webserver (not your mail server). I found many sites to tell you what to do there. So far, all is well.
Second, if you’re like me you would eiher get the sending error forever or a message failed. odds are you’ve done something in the middle of that and you don’t know what it is. Let me tell you - from the box you were getting a “sending” after messing with the php file you got the message failed. The difference is that you changed the “youremail@yourdomain.com” to your actual settings. if you’re getting the sending message forever do this - type in http://%yourwebsaddress%/send_email.php.
If you get an error - congrats you’ve installed PHP if not. . .reconfigure your php.ini file to the recommend settings.
NOW for the fix - the problem (if you’re like me) you thought that when you changed “youremail@yourdomain.com” the php and flash was smart enough to figure out that “yourdomain” was were you wanted to relay off of. Not the case. Open the php.ini file and do a search for “SMTP.” that defaults to “localhost.” And if you’re like 80% of the planet your mailserver isn’t the same as your webserver. This was my problem. I changed local host to my pop3 server and - many happy dances - it worked.
Please let me know if this works -
Bill
145 reza // Mar 5, 2009 at 12:07 pm
hi bill.
how do i open the php.ini file ?
where is it?
do i need to go my web server control panel?
are you saying the send_email php script is correct?
plz let me know
i am just about get crazy about this form.
thank you
146 Chris // Mar 6, 2009 at 12:41 am
it just does not work! The demo code, even after changing the email address, does not work. YES I can run PHP (seriously, who can’t these days??)
I did notice a slight mistake in the send_email.php file - in line 4, there is a ‘ before sender when it should be a ` I even changed this and it still does not work.
147 Bill Cole // Mar 7, 2009 at 1:50 pm
Hey Reza -
The PHP.ini file should be in your program files, under PHP of the server that your website is on - again, NOT your mail server (unless they are the same).
Open it as a txt document from notepad.
I did have to restart IIS after I changed the PHP.
Yes, the script works (I do know how that sounds - a few days ago I would have called me a liar). Odds are your trying to relay off your local host (the ini’s default setting). Meaning that it’s just spooling trying to send. . .but doesn’t.
Stick it out - the beer after you realize the mistake is priceless.
148 James Bavington // Mar 13, 2009 at 4:48 pm
Great tutorial, I’ve managed to get that working on one of my testing servers. I have a question though, it mentions in the tutorial that it has basic validation methods.
Is the form 100% bullet-proof with regards to getting spam, or can bots fill out Flash contact forms?
If so, how do I go about addi