Dreamweaver Tutorial - Create a Contact Form In Dreamweaver
In this tutorial you will learn how to create your all important Dreamweaver Contact Form and have the details of the form emailed straight to your INBOX. Capturing Contact Information of potential customers in extremely important in the business world. Don’t let those potential customers or clients disappear just because you didn’t have a Contact Form on your website. By following this Dreamweaver Tutorial you will have a WORKING Contact Form up and running in a few easy steps.
NOTE: Before we start you will need to download this PHP Form to Email Script and unzip it to the root directory of your website. A file named FormToEmail.php will be there.
Now you are ready to begin inserting the form and the fields you would like onto the page. In this example I am going to create anew page, but you can easily add this to an existing page if you already have one in mind for the form to be placed on.
1. In Dreamweaver, choose File > New The New Document Dialog Box appears.
2. In the Blank Document list, choose HTML, then click Create to create a new HTML document.
3. In the Title text field in the Document toolbar, enter Contact Form to add a title to your document.
4. Choose File > Save, then save the document in your local site folder. Name it ContactForm.htm.
5. Next we are going to Insert a Form onto the page, Choose Insert > Form then Form from the Flyout Menu. A Form dialog box will then open. In the Action text box type in FormtoEmail.php (this is the file you extracted to the root of your website earlier). Change the Method to POST and then in the NAME text box type in ContactForm.
6. Next step is to place the form objects onto the page (the information we would like to collect). In this example I have placed a text box for Name and Email Address, and also a Text Area for Comments. To do this click inside your form object and then from the top menu select Insert > Form > Label. From the Code Window click in between the LABEL Tags and type in Name:. Next from the toip menu again select Insert > Form > Text Field. Name the Text field name from the properties box at the bottom.
Repeat those steps and add another Label and Text Field and name it email.
7. Add another Label and type in Comments. Then add a Text Area, go to Inset > Form > Text Area in the top menu. Name the Text Area comments from the Properties box at the bottom and give the Character Width a value of 50 and the Number of Lines a value of 10.
8. Add a Button. Again from the top menu Insert > Form > Button. Your Form should now look like this: (note I have put each element on a different line to help with the usability).
9. Now we need to edit a couple of lines in the FormtoEmail.php file. Open the file in Dreamweaver. The first line you need to edit is the line that starts with $my_email.
Change the email address to the address you want the emails to be sent to. The other line that you may wish to change is this one:
This is where the visitor will be directed after they have pressed the SUBMIT button. If you have a page that you like to direct them to then place the location of the file in there, or simply leave it blank and they will get a thank you message on the same page.
10. Upload both files to your web server and bingo all done. You should know have a working contact form.
In an upcoming Tutorial I am going to show you how to use Dreamweaver and CSS (Cascading Style Sheets) to jazz up your forms with a bit of style! So make sure you SUBSCRIBE to my RSS Feed so you don’t miss out.

You can follow any responses to this entry through the RSS feed. You can leave a response, or trackback from your own site.


March 7th, 2008 at 5:28 am
Excellent! Thanks for the step-by-step. It looks easy.
March 19th, 2008 at 2:46 am
That’s it? That’s all one needs to create an e-mail form? Here I thought I’d need a DB set up and ready to go. Very cool.
March 19th, 2008 at 11:16 am
One issue I’m having… the e-mails don’t seem to actually send. Everything seems to work right, but no e-mails seem to be going out. I’ve checked and double checked, and everything is input correctly it seems…
March 19th, 2008 at 12:15 pm
Yep, it definitely won’t actually send the e-mail and I’m not sure why. Everything is done as directed… could it be my hosting service, GoDaddy.com’s issue?
March 21st, 2008 at 5:25 pm
Hey thanks This was easy and it helped me learn dreamweaver more.
March 21st, 2008 at 10:46 pm
@Bildo
Just check with your Host and see whether you are able to relay through their mail servers. It sounds like that may be the issue
Cheers
Daniel
March 28th, 2008 at 7:58 am
I’m practicing and learning dreamweaver and this tutorial was excelent, very simple and really works!
April 3rd, 2008 at 2:10 am
Great and simple. Although the continue link doesn’t take me to the page i intend. it goes straight to the php page and then I have to click the coninue button. Any way of just linking straight to the intended page?
also the thing doesn’t work in Safari?!
April 4th, 2008 at 7:50 pm
Great Stuff. What I have always been looking for. Thanks
April 4th, 2008 at 9:50 pm
I have followed the instructions but it didnt work. As ssoon as I press the submit button it isays page cannot be found.
Thanks,
ilker
April 5th, 2008 at 5:39 am
just followed the tutorial and got the same results as ilker “file not found” and no email was recieved. i’m also hosted on godaddy, didn’t see any response to that question.
April 5th, 2008 at 8:08 am
@Iker and @lee
Make sure you check that the file is in the correct location and that the Form Action value is exactly the same as the file name (case sensitive).
Cheers
Daniel
April 6th, 2008 at 6:31 am
to those using godaddy… they suck. get a new host. i’ve had so many problems with clients that use them. they don’t allow you to use any 3rd party scripts for emails or anything. supposedly it’s to be more “secure”. but it’s just annoying.
April 6th, 2008 at 8:22 am
@timmy
I have heard bad things about GoDaddy as well. I use BlueHost and Highly recomment them
Check them out here if you want to change.
Cheers
Daniel
April 7th, 2008 at 7:46 am
I’m making a website, it’s not online yet so i’m working on it in on my local server…
When I did this tutorial and pushed send, to try it out, I got the question if I wanted to download the “FormToEmail.php” file…
Am I’m doing anything wrong or is it just me?
April 7th, 2008 at 10:26 pm
it doesn’t work for me (i followed the tutorial and got the same results as ilker “file not found” and no email was recieved.)
April 8th, 2008 at 5:45 am
I am using GoDaddy and Having problems with them as well
April 8th, 2008 at 12:20 pm
G’day Everyone
Thanks for all your comments. It seems a lot of people are having issues with GoDaddy. From what I can gather they do not allow you to run 3rd Party Scripts. If that is the case then this will not work.
If anyone has recommendations for these people on Hosts that they use then please share your thoughts. As I have said in an earlier comment I use BlueHost and find them really good.
On another note a few people have emailed me with problems like “File Not Found Error”. Just make sure that you double check the file location and also the name of the file. It is case sensitive so that is causing the issue for some.
Cheers
Daniel
April 11th, 2008 at 4:31 am
Dear Daniel,
Its looks cool i done all but not yet uploaded.Will be posting result after upload.
You are simple great
April 11th, 2008 at 9:28 pm
Hey just to let you all know, for Godaddy you just change the FormTomail.php to gdform.asp
Thanks for your help in setting up the forms though!
April 17th, 2008 at 6:10 pm
Great Stuff. What I have always been looking for. Thanks
April 18th, 2008 at 12:56 pm
Dude it works. I had to capitalize the ‘T’ in FormToEmail but that was a quick fix and you rock.
Stay coo.
April 20th, 2008 at 11:08 am
Hi Daniel,
Thanks so much for the script. I am a total Dreamweaver newbie and this was so much less confusing than the other tutorials I’ve found. I did however have the same problem as the others with the message saying “URL not found” (or whatever!) after I clicked the Submit button. I’ve found a weird glitch with Dreamweaver and wanted to pass it on. Whenever you have the option of either typing in a file name or navigating and choosing the file…DEFINITELY go with navigating and clicking. I’ve found no matter how exact you’ve typed something Dreamweaver somehow doesnt recognize it. When I type in FormtoEmail.php….it doesnt recognize it and I got that URL not found message. When I navigate to it BINGO! It likes it then and the form works great. For whatever its worth to everyone out there, give it a try. It worked for me! Have Fun!
April 22nd, 2008 at 11:46 pm
I really hope you can help me. I have spent days trying to set up a Reply Form on my website using “Matt’s Script Archive” etc and when I came across your website I thought yipee! I have copied the file FormtoEmail.php into my root website directory (its there twice actually as FormToEmail.php too) and the file which contains the actual form - programmed as follows (to match your instructions). I get a 405 Error which is a “website programming error”. Please help.
Name:
Company:
Email:
April 22nd, 2008 at 11:57 pm
Sorry… the text in Dreamweaver looks like this.
Name:
Company:
Email:
April 25th, 2008 at 6:23 am
[...] the contact and links page, i used a step by step guide at http://dreamweaverspot.com/adobe-dreamweaver-tutorial-contact-forms/ which helped me insert a contact form on my [...]
April 26th, 2008 at 5:04 am
This tutorial was very helpful. It was short, sweet, and to the point. It was easy to understand, so for beginners like me, you should definitely give it a try.
I think, however, that it should be a little more attractive with more images, but the content was excellent.
April 26th, 2008 at 5:07 am
Short, sweet, and to the point. Most importantly, very helpful. Should be more attractive, in terms of images and colors, but the content really worked/helped.
April 28th, 2008 at 10:20 am
Awesome work !!!!
April 29th, 2008 at 3:37 pm
Great tut, everything is working great. One question though. Is there a way to make the thank you message a popup?
April 29th, 2008 at 7:08 pm
Hi,
Great tutorial, still trying to get it to work, My question.
Does this work whilst using WAMPSERVER on my local computer?
Many thanks and keep it up!
John
April 29th, 2008 at 11:29 pm
@John
I am not to familiar with WAMPSERVER from what I can gather it is Apache, PHP, MySQL on Windows right?
For this to work you need to have an SMTP Server to be able to send the mail.
Cheers
May 2nd, 2008 at 11:48 am
Hi Daniel,
Thanks so much for the script, but I have a problem to run the Contact Form. It was running 2 days and it stop working. I contacted the web.com and they told me if the PHP script is over 4.3.2 than you will have to upgrade the plan. So, my question is what is the code of the PHP?
Thanks again
Fred
May 2nd, 2008 at 9:09 pm
For others, the reason you are getting not found errors is that in the TUT it doesn’t capitalize the ‘T’. Check your case.
My issues is that once I hit submit on the site, it says that YOU CANNOT SUBMIT AN EMPTY FORM
ANy idea why this is?
May 2nd, 2008 at 9:30 pm
NM I had a bad field in my form within dreamweaver, this solved it. I get the form to email perfectly, just two questions.
With the submit button, how can I stop the emails from saying Submit = Submit at the bottom.
Also how to I change the From field. Currently it’s popping up as Whatever@fairfax.dreamhost.com (yes I use dreamhost)
Is there a way to adjust that? Or is it server side?
May 3rd, 2008 at 7:52 am
I am having what looks to be the same issue where everything works great but I don’t get the emails. Where in the code does the mail server info go? I use Gmail, will this work?
May 3rd, 2008 at 8:41 am
For those that have been trying to upload the PHP file on GoDaddy, GoDaddy has its own PHP file for contact forms that works very well. See their help section.
May 5th, 2008 at 5:13 am
Thank you so much. It was very easy and helpful…
May 6th, 2008 at 12:09 pm
hi i test it & it work very well but
i make a test to send to one of my emails but it go to the spam
what can i do to have it normaly in mybox
thanks
May 7th, 2008 at 7:08 am
[...] tutorial is from Dreamweaver Spot that give you info about how to create a PHP contact form for your [...]
May 7th, 2008 at 12:23 pm
@sherif
This could be to do with many things, spam filter levels on your mailserver, the content that is being typed into the fields etc.
Some things to check anyway, Who is hosting your mail?
May 8th, 2008 at 5:46 pm
I fallowed the tutorial but the e-mails are not being sent to my inbox. Everything else is working properly. I use Yahoo as a host. Is there anything else I need to do?
Thanks
May 9th, 2008 at 8:40 am
You are my hero! It totally worked! Thank you!
May 11th, 2008 at 10:21 pm
Have set it up and works as it should, HOWEVER: when i receive emails from the form, it shows up as having no sender, and as a result it goes straight to spam filter. My spam filter will not allow me to add it to safe senders list, because of this reason (no sender info). Can i adjust the script so that there is a sender field in the email??
thanks
May 13th, 2008 at 9:18 pm
I get a message after clicking the submit button which reads: Method not allowed - The requested method POST is not allowed for the URL/FormToEmail.php. Any ideas?
May 13th, 2008 at 11:40 pm
@Casa
This usually means that the server does not support PHP, contact their Tech Support and find out.
Cheers
Daniel
May 14th, 2008 at 12:27 am
I finally got the form to work, but after saying that it has been sent i dont receive anything
May 18th, 2008 at 2:53 am
Brilliant tutorial, thank you! After I got out of trying to think ahead and followed your instructions it’s integrated and working great! I’ve even managed to make it work with graphical fields and several other functions. Very impressed. Thanks for your help!
May 20th, 2008 at 5:57 am
Hi,
I followed this tutorial for a form on my mates site, however whenever i go to send the message and click the submit button, it trys to download the “FormToEmail.php” file?
My form action is exactly as yours, and my php file is as exaclty as yours is.
any help?
Thanks
Justin
May 25th, 2008 at 6:28 pm
When I hit submit it tries to download the FormToMail.php
my site is hosted on mac.com
May 28th, 2008 at 9:11 pm
goodday:
i am so glad that you had given a well detailed tutorial but unfortunately some of its part are malfunctioning such as handling of errors..its enable to send message even the forms are blank. try to visit my trial site:http://www.jrmsc-tc.com/comments.html
please help me with this..
your email is much appriciated
vanny12_34@yahoo.com.ph
May 31st, 2008 at 1:56 am
Thanks for the definition of a great tut. However, when I hit the submit button it gives me the following view:
64 || empty($exploded_email[1])){$errors[] = “Email address is invalid”;}else{if(substr_count($exploded_email[1],”.”) == 0){$errors[] = “Email address is invalid”;}else{$exploded_domain = explode(”.”,$exploded_email[1]);if(in_array(”",$exploded_domain)){$errors[] = “Email address is invalid”;}else{foreach($exploded_domain as $value){if(strlen($value) > 63 || !preg_match(’/^[a-z0-9-]+$/i’,$value)){$errors[] = “Email address is invalid”; break;}}}}}} } // Check referrer is from same site. if(!(isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST']))){$errors[] = “You must enable referrer logging to use the form”;} // Check for a blank form. function recursive_array_check_blank($element_value) { global $set; if(!is_array($element_value)){if(!empty($element_value)){$set = 1;}} else { foreach($element_value as $value){if($set){break;} recursive_array_check_blank($value);} } } recursive_array_check_blank($_REQUEST); if(!$set){$errors[] = “You cannot send a blank form”;} unset($set); // Display any errors and exit if errors exist. if(count($errors)){foreach($errors as $value){print “$value
“;} exit;} if(!defined(”PHP_EOL”)){define(”PHP_EOL”, strtoupper(substr(PHP_OS,0,3) == “WIN”) ? “\r\n” : “\n”);} // Build message. function build_message($request_input){if(!isset($message_output)){$message_output =”";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace(”_”,” “,ucfirst($key)).”: “.build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).”, “;}}}}return rtrim($message_output,”, “);} $message = build_message($_REQUEST); $message = $message . PHP_EOL.PHP_EOL.”– “.PHP_EOL.”"; $message = stripslashes($message); $subject = “FormToEmail Comments”; $headers = “From: ” . $_REQUEST['email']; mail($my_email,$subject,$message,$headers); ?>
Thank you
Your message has been sent
Click here to continue
HELP!!!
May 31st, 2008 at 3:06 am
this form to email thing is a damn nightmare…
June 2nd, 2008 at 12:55 pm
hi
June 2nd, 2008 at 1:03 pm
goodday:
i am so glad that you had given a well detailed tutorial but unfortunately some of its part are malfunctioning such as handling of errors..its enable to send message even the forms are blank. try to visit my trial site:http://www.jrmsc-tc.com/comments.html
please help me with this..
your email is much appriciated
June 3rd, 2008 at 6:01 am
the form works awesome! I could be wrong, but I think that you would have to change the javascript to have mutiple forms to different e-mails on the same page, correct? What needs to be changed in the code to do this?
June 3rd, 2008 at 6:24 am
doh! please disregard everything I just wrote…..I was looking at some other code….
June 3rd, 2008 at 6:10 pm
Hi mate,
I have the same issue as Justin. When I hit the submit button it also attemps to download the “FormToEmail.php” file? What could be causing this?
Many thanks and great tutorial
June 7th, 2008 at 5:29 am
My pages work but no email arrives in my inbox. I’ve checked I entered the correct address etc. I’m hosted by Freehostia and I’m waiting to hear back from their helpdesk so if anyone can help in the meantime that’d be great.
Thanks.
June 12th, 2008 at 1:33 pm
This is fucking outstanding! THANK YOU VERY MUCH. I was struggling until I hit this page. You’re my hero…for today.
June 12th, 2008 at 2:14 pm
Okay, how can I modify this PHP to allow for different forms? I have one on a page for business contacts (go to business MGR) and I have the main contact page (goes to admins).
How can I do this? Just rename the PHP file, and specify it per form?
MMMMM, good idea Blake. I’m gonna try that.
June 13th, 2008 at 8:38 am
I 2nd that. I can’t tell you how much i appreciate this.
June 16th, 2008 at 10:05 pm
thanks man
June 19th, 2008 at 10:31 pm
I tried several different form codes until I got to yours. Thanks so much! My emails are going through just fine. My issue is being able to send a blank form. I would like for the information to be required. Looks like your php file is telling it to look, so any ideas what the problem might be? I appreciate your help greatly. This was a huge help.
June 20th, 2008 at 6:12 am
Great stuff!! Thank you sir!
June 20th, 2008 at 8:54 am
I cant get this thing to work. tried 2 times. I use 1&1 and they support php
June 20th, 2008 at 6:34 pm
Thanks Man it work great
June 20th, 2008 at 8:24 pm
Dear Daniel,
Its looks cool. I have done all but not yet uploaded.Will be posting result after upload.
You are simply great and u deserve a big prayer.
June 20th, 2008 at 8:44 pm
Moreover, testing it on a system without any local server on it resulted out a download dialog box. Why? is it because it is not connected to the internet or not uploaded. Response needed!
June 20th, 2008 at 10:47 pm
Thanks, this is great, very helpfull. It’s all working except that it doesn’t seem to detect blank forms (as others have found) although the code looks as though it should. It detects invalid characters in the email OK. Tested under both PHP4 and 5.
June 21st, 2008 at 1:33 am
Hi, please can you tell me which software is best for BANNER ADS and WEB ANIMATIONS. Please. I will be glad to read from you soonext. Thanks for the Dreamweaver tutorial.
June 21st, 2008 at 3:20 am
Problem solved - If you’ve clicked the Submit button, the array $_REQUEST is never blank as it contains an element with key (name) “Submit” and value “Submit”.
In function recursive_array_check_blank($element_value), change the line
foreach($element_value as $value){if($set){break;} recursive_array_check_blank($value);}
to
foreach($element_value as $value){if($set){break;} if ($value != “Submit”) {recursive_array_check_blank($value);}}
Note that this code is working with the ‘value’ of the form’s object (i.e. the text that appears on the button), not the ‘name’ of the object.
June 22nd, 2008 at 12:38 am
Thanks heaps mate! Sends emails for me - but for some reason I get a “Submit: Submit” in the body of every message and it lets the form be submitted even if the fields are blank. I get the ‘blank emails’ delivered with a default from address added from my hosting provider and that “Submit: Submit” in the body..
But it’s better than publishing an email address on my site - so thanks!
June 23rd, 2008 at 5:04 am
Hey Dan,
Get one tx a million, had the text issue when page not found due to capital T in the MailToForm. Sorted that now though. Question though, is there a way to auto redirect away from the results page back to the website home page?
June 24th, 2008 at 2:28 am
I too have been having a problem that others on this page have also had…..when submit is clicked 404 page not found appears. I copied everything exactly the same and inserted my own email into the code then put it on the server. I know yahoo small biz allows php but i wonder if there is something I need to do on the domain management page to allow this to work? Anyone else with Yahoo out there?
Any help appreciated,
Dave
June 24th, 2008 at 4:39 am
Hopefully someone can help me. Everything works fine, except I don’t get any email reply. I am using Go Daddy, and I tried changing the php file name as the person above suggested…but still nothing. The website is sueellenking.net…click on “Request A Quote” on the right hand side and the form will come up. I fill everything out, hit submit, get the thank you page and no email. Thanks in advance for anyone who can help.
June 24th, 2008 at 7:33 pm
The Email wont work??/
June 27th, 2008 at 1:42 am
Hey, I was wondering about this tutorial. I have done everything on the tut but when I try it out in the browser the form just resets itself and then nothing is sent to my email and the page is not reset to my homepage. Any input on this?
June 28th, 2008 at 6:57 am
Hi Dan!
You saved the day at my office, as we needed to get a contact form up TODAY, and I have never made one before. It works beautifully, and my only glitch is if a person leaves the “Email:” field blank and hits “Submit”, it moves onto the “Thank You..” page and give me this message instead of applying the form validation:
“Warning: mail() [function.mail]: SMTP server response: 554 The message was rejected because it contains prohibited virus or spam content on line 116″
haha what? Not really sure why it does this instead of just telling me I need to put in the email address. It works fine if you at least type something in the box, but not if you leave it blank?
Thanks for being such a good sport with all these questions!
C
June 28th, 2008 at 7:23 am
Dan,
Hooray! Please disregard my above comment, I did some scouting around on your site and found your amazing little article on form validation. Plugged that in and it works wonderfully now! You have been awesome, and I am definitely going to be a frequent vistor on your site.
Thanks a million! If you’re ever in Florida let me know and I’ll bake you some cookies! :O)
-The happiest graphic designer in Orlando
June 28th, 2008 at 10:51 pm
I do not normaly reply to this kind of posts, but this is the first form that actually worked. Congrats man, respect for all the tutorials and the time u spent trying to teach us noobs.
July 1st, 2008 at 12:19 am
I have got the form to work in some sense, I can fill out the information and then when I press SEND the thank you page comes up, but no email was sent. How long does it take to get the email of stuff?
July 10th, 2008 at 1:05 am
I was wondering do I need to upload this to an ftp site for it to work, it wont just work through my computer and dreamweaver alone will it?
July 10th, 2008 at 7:47 am
works awesome.
July 10th, 2008 at 1:16 pm
trying to get the form to send emails and when clicked it says everything went through. I have ixwebhosting and php is turned on. What else needs to be configured? Im not getting the emails and have doublechecked
July 10th, 2008 at 3:43 pm
Thanks man this is an absolute charm!!! Thanks for sharing this tute with us.
July 11th, 2008 at 3:57 am
I have gone over this relentlessly and cannot find what is wrong. We have a local server, no godaddy type company, yet the submit button does absolutely nothing. any ideas?
July 12th, 2008 at 12:11 am
Hi Dan,
Great script. It all works fine except for one minor problem my end. I am building a secure login site using a combination of HTML and PHP. At the moment I am hosting my site using MAMP on my local machine.
The problem is when I submit the form. I get the correct response but no email appears in my inbox? Any suggestions?
July 14th, 2008 at 12:31 am
i receive the email… but during at thar time my printer and pc problem so i cannot print the dreamwaver for me again
sorry for the probelm….
July 14th, 2008 at 2:21 pm
I can’t get it to work for some reason. I think it may be my host. I have Yahoo! Small Business web hosting. I know that we are allowed to send up to 250 emails from a third party per day, but I’m not sure why your form isn’t working. I never receive the emails!
July 15th, 2008 at 11:31 pm
Hi Daniel,
Thanks for sharing your wisdom… i really appreciate it!
One quick question…
In this forum a few people have asked how do you get rid of the Submit: Submit” in the body of every email message that comes in.
Have you got any ideas?
July 19th, 2008 at 4:57 am
Great stuff. Worked first time. Much appreciated.
July 25th, 2008 at 9:55 am
hey.. thx for the tut, awesome.. but i get this:
what am i doing wrong? hmm..
i’m a dumbass with code :]
Warning: Unknown(): open_basedir restriction in effect.
File(/usr/www/users/garviz/FormToEmail.php) is not within the allowed path(s): (/usr/www/users/garvie:/usr/home/garvie:/tmp:/usr/local/lib/php) in Unknown on line 0
Warning: Unknown(/usr/www/users/garviz/FormToEmail.php): failed to open stream: Operation not permitted in Unknown on line 0
Warning: (null)(): Failed opening ‘/usr/www/users/garviz/FormToEmail.php’ for inclusion (include_path=’.:/usr/local/lib/php/’) in Unknown on line 0
August 9th, 2008 at 5:48 am
Mine is working perfectly thank you very much, the only problem is that i recieve the contact form with al its info to my e-mail, but i recieved it as if i was sendind it to everyone. dont know if i explained myself.
E.g.
my e-mail is (example) popcorn@you.com and every single form i recieve is addresed that was sent by popcor@you.com
Why is that happening? I rechecked the hole script and my e-mail is nowhere to be found, where is the contact for getting that e-mail from? And what is the default sender supposed to be? The website? http://www.mycompany.com
August 15th, 2008 at 12:22 am
Does it supports Russian Cyrillic?
I’ve tried 2 PHP forms already, all of them failed. My hosting has nothing to do with that. I use correct encoding, but still receive only rubbish. All Russian letters get converted to some ASCII symbols.
Will test yours sometime. But maybe you know the answer already?
Thanks
August 17th, 2008 at 10:02 am
Oh, thanks man! I hate scripting and I have finally found the holy grail of websites to help ease my pain. Thanks!
August 19th, 2008 at 3:22 pm
@Robert: Quote
“Hey just to let you all know, for Godaddy you just change the FormTomail.php to gdform.asp
Thanks for your help in setting up the forms though!”
I tried this. I even changed the form mailer in the account settings. Still no mail is showing up at the intended destination. Any help?
August 24th, 2008 at 6:59 am
Hi,
I have the same problem Justin discribed earlier:
I followed this tutorial for a form on my site, however whenever i go to send the message and click the submit button, it trys to download the “FormToEmail.php” file?
My form action is exactly as yours, and my php file is as exaclty as yours is.
any help?
Thanks
Theo
August 25th, 2008 at 2:01 am
Hello,
Thanks for the tutorial. However, I am getting “Page cannot be displayed” error when the user clicks on the Submit button. I am using Web.com as my host. This is for a magazine publisher. I am testing my contact form for Web related issues to direct to my email. Any suggestions?
Thanks,
Kevin
August 25th, 2008 at 10:41 am
Thanks for this tutorial.
Only problem I have is:
If I enter the email with some errors in it I have a message that says:
Email address is invalid
How do I center this error message… Also my contact form is in a table with graphics behind it.
I was able to trhow in my table in the php file so the thank you not is inside my table.
But for the error message, its not working… any ideas?
August 26th, 2008 at 3:04 am
is there a way that you can put two emails in the following line of the php file? so that the information is sent to two different addresses?
$my_email = “myemail@mydomain.com”;
great tutorial. thanks.
August 27th, 2008 at 3:37 am
*** FOR PEOPLE RECIEVEING TEH FIle NOT FOUND PROBLEM!***
The file not found problem may be happening to people who are followoing step 5, and actually copying the line of code. in step 5 is says “FormtoEmail.php” when the file is actually named “FormToEmail.php” capitol T. change that and it will sort the issue
Now a question - How can we stop the mails goign straight to jumk???
August 27th, 2008 at 3:55 am
Also guys, I noticed that a few peopel want to know how to validat ethe form. If you use dreamweaver its simple. On you comments page, in design view, select the submit button.
then select the “behavious” tab. I f you cant see this tab go to Window>behaviours. once you are in the behaviours tab click the little + button and select “validate form”. you can then for the validation of an email address, if the user doe snot input an email address a pop up box will appear advising of this.
August 31st, 2008 at 11:12 am
excellent stuff. you make it so simple.
thanks.
September 2nd, 2008 at 4:31 am
to get rid of the aubmit: at the bottom of the email, click on the submit button in DW, go to the properties at the bottom of the screen and clear out the “button name” box.
September 2nd, 2008 at 5:23 am
If you have GoDaddy, cerify whether or not you are using Linux or Window hosting. If your site is hosted on a Linux server, .php will work without a problem. If you have a windows server, .asp is the type of scripting you need.
According to support at GoDaddy, they do not have any limitation or restrictions on php scripts - at least not on Deluxe hosting. Free hosting may be different, but it would be worth your time to ask. Their support has been very helpful.
i had to request my site to be moved to Linux servers in order for the php scripting to work, which will take 24-72 hours before it is switched over. But worth the wait to make sure I can do what I need to get my site up and running. So before you spend days trying to figure out why the php script wont work, check your hosting first to see if you have Linux or Windows. This could potentially be your problem, as it was mine.
Have a Great Day!
September 2nd, 2008 at 9:49 am
Daniel,
The tutorial was excellent, “but I am still not able to get it to work. Everything is exactly as it is supposed to be. I use Bluehost as a service provider. They are closed today because it is a holiday. Request form link is where my ContactForm.htm is located. Can you look at my code and give suggestions? Please
Thanks David
September 3rd, 2008 at 12:56 am
I’m getting a message stating, “You cannot send a blank form”. Any suggestions? The web designer that created the site no longer works here. She used your FormToEmail.php for our contact page, which works, and our “Sign up for updates” (on every page), which doesn’t work. Do you know why it works in one spot but not the other? Any suggestions would be greatly appreciated. Yes, we are using GoDaddy.com and we are on a linux server but I’m assuming that has nothing to do with the problem since it is working on the “contact us” form. I saw this code in the php form,
if(!$set){$errors[] = “You cannot send a blank form”;}
Does this have anything to do with it?
September 4th, 2008 at 6:16 am
You Are my Hero, been looking all day for contact forms that work, This is amazing and really really easy to follw for beginners thanks
September 5th, 2008 at 7:17 pm
Thanks for a brilliant tutorial, but I have a query. Once I click submit, I am getting the following error:
Warning: mail() [function.mail]: SMTP server response: 550 A valid From header is required for bounces in E:\Inetpub\saiipl\FormToEmail.php on line 116
September 6th, 2008 at 11:20 am
Hey! This works ok in terms of the script, BUT when i fill in the form and click ’submit’ it says ‘you cannot submit an empty form’ even thoguh teh form was filled in…where have I gone wrong?? :s
Thanks in advance…amazing tutorial btw!
September 6th, 2008 at 11:30 am
I followed your instructions. But, I’m not sure how to insert the form on an existing page? I want to add it to the bottom of a page with all the field box visable and not have to go to a diffrent contact page. Can you give me any help.
Thank you
September 11th, 2008 at 6:56 am
[...] I forgot to mention, credit for the code of the form goes to…http://dreamweaverspot.com/adobe-dreamweaver-tutorial-contact-forms/ All I did was modify the code to my liking. « Here we go again, IE VS. [...]
September 14th, 2008 at 3:21 am
thanks this contact form works well for me
very good tutorial thanks again
September 15th, 2008 at 7:34 pm
what i done wrong?!…. when i press submit it gives me the download window for formtoemail.php:|…
September 19th, 2008 at 1:57 am
How can I make the fields required and remove the submit: submit in the emails?
Thanks this works great!
September 20th, 2008 at 7:01 am
Wow, I’ve been working on this problem off and on for a couple of days now. You’ve just saved me. I’m definitely subscribing.
September 23rd, 2008 at 8:34 am
The funny thing is that I used the script forone website (www.triniteedesigns.com) and it works fine, I then went to use it for my personnal site, but I am having problems. Both are hosted by Go daddy. Has anyone gotten to the bottom of the issue?
Thanks Tim
September 23rd, 2008 at 9:49 pm
Hey Daniel
Many thanks for the contact script - fantastic. Only one thing….
When I tested it out, I used my email address as the recipient (this email actually). For some reason it gave me the following error:
Warning: mail() [function.mail]: SMTP server response: 554 : Recipient address rejected: Relay access denied in \\nas39ent\domains\j\jaysdriving.co.uk\user\htdocs\test\FormToEmail.php on line 116
I changed the email to another and it worked ok first time - then gave me the same error…
Any ideas mate? Many thanks in advance
September 24th, 2008 at 9:56 am
finally! i found a working tutorial! thnx dude!
September 25th, 2008 at 7:06 pm
It works perfect my friend.
Thanks very much.
October 1st, 2008 at 8:11 am
I’m wondering how to do 2 more things with this code. I want to e-mail the results to 2 e-mails and I want to e-mail the user’s IP address too. How do I do that? Thanks.
October 1st, 2008 at 7:07 pm
Works great except that the php file doesn’t validate the inputs. Does anyone have an idea of what would be thw problem?
Thank you
October 2nd, 2008 at 7:34 am
Wow! Thanks so much Daniel! It works great!
I also had the 404 not found error, but I did exactly what Cynthia said, and boom! all fixed!!
October 2nd, 2008 at 6:45 pm
Hello,
Thanks so much! Ive been trying to achieve this all day..no joke! the only step which threw me was 5. you must put FormToEmail.php not FromtoEmail.php (the T has to be capitalized). Thanks again Dan
Kyle
October 6th, 2008 at 10:07 am
I seem to get the following errors when loading the form as per tutorial
Help anyone
Thanks
Shaun
October 6th, 2008 at 10:08 am
Helps to include the error message……..sorry
Notice: Undefined index: email in \\nas30ent\domains\t\travelpromoters.co.uk\user\htdocs\FormToEmail.php on line 114
Thank you
Notice: Undefined index: name in \\nas30ent\domains\t\travelpromoters.co.uk\user\htdocs\FormToEmail.php on line 133
October 10th, 2008 at 2:41 pm
hi, I am really not good at Dreamweaver, but I got it right!
one thing is that I don’t get name or comments in my e-mail.
I just get there e-mail.
What am I doing wrong…?
October 10th, 2008 at 2:43 pm
oh actually…
I see “submit”
I don’t get any subscriber’s e-mail address in my e-mail…
October 10th, 2008 at 2:51 pm
!!!!!!!
I got it!
I was making the Form for each “email” “name” and “Submit”
That’s why I only saw “submit” when i got email.
THank you~! this is wonderful!
October 12th, 2008 at 3:55 am
Hi there - I seem to have stumbled into a road block - everything seems to be working fine with the form… in that you can type in each field and hit submit which redirects me to a continuation page
however - i’m not finding the emails once the form has been submitted. i’ve changed my “$my_email = “fake@email.com”; - but it’s not getting sent there.
any ideas?
Thanks.
October 13th, 2008 at 4:43 pm
Thanks mate - good tutorial!
October 14th, 2008 at 8:28 am
I thought creating a form was going to melt my brain. Thank you for making it so easy
October 14th, 2008 at 11:04 pm
Thank you for the tutorial and free script, however I have just tested it and I get the following message upon submitting the form: You must enable referrer logging to use the form.
Any suggestions as to why this is occurring??
October 17th, 2008 at 3:17 pm
thnks man….simple, easy….
visit here http://www.hasrilhusni.com/contact.html
October 18th, 2008 at 2:02 am
i do it by tutorial. When i click on submit button. It write: Forbidden
You don’t have permission to access /FormToEmail.php on this server.
October 19th, 2008 at 1:16 am
Gave this a try live with a temporary testing site, and after a couple of false starts got it to work OK.
One problem remains some email SPs will dump the email in a “junk” folder on receipt, (hotmail) while others will accept it in the normal “inbox” (tiscali).
I tend to think this might be because there is nothing in the “From” box, so it’s filtered to the “junk” folder.
As I use mail alerts to my mobile phone, I would like to know if there is any code that I could use to just add a dummy “From” address to each email sent so that it doesn’t get filtered out as junk.
As I’m just starting with PHP I can’t see how myself, but any help would be appreciated. It would be nice to get rid of the double Submit at the bottom too.
Many thanks Terry.
October 22nd, 2008 at 6:43 pm
Bryce (See April 18th, 2008 at 12:56 pm), capitalized the ‘T’ in FormToEmail solved the problem. Cheers.
Thanks a lot Daniel!!!!!!
October 25th, 2008 at 2:30 pm
Hi,
I followed this tutorial for a form on my mates site, however whenever i go to send the message and click the submit button, it trys to download the “FormToEmail.php” file?
My form action is exactly as yours, and my php file is as exaclty as yours is.
any help?
Thanks
Marek
October 29th, 2008 at 4:10 am
HI!! Thanks it is awesome and it worked!!
I’ve still got one problem though. I tried to add a drop down list, however the value of the drop down list item did not arrive in my inbox together with the rest of the information.
Anything I can do to make this work?
Thanks again.
October 30th, 2008 at 11:37 pm
AMAZING… thank you so incredibly much!!
November 2nd, 2008 at 2:23 am
If anyone hasnt figured out yet how to put a subject or who the mail is from you need to mod. this sting..
Lines 112 - 114 on my comp.
$subject = “FormToEmail Comments”;
$headers = “From: ” . $_REQUEST['email'];
To this (make it whatever you want, this is just what mine looks like)
$subject = “Question From Customer “;
$headers = “From: Way-BrightPools” . $_REQUEST['email'];
That way you can mark it as safe and it wont go into your junk folder! Hope that helps some ppl! Took me few hrs to fig that out lol
November 2nd, 2008 at 4:33 am
Hey everyone, If anyone is have a problem with your mail getting sent to the junk folder and not having a subject. After 3 redbull and a long night i figured it out. lol Hope this helps out.
On lines 112 - 114 the current string looks like this:
$subject = “FormToEmail Comments”;
$headers = “From: ” . $_REQUEST['email'];
This is what mine looks like (change yours to fit your needs)
$subject = “Question From Customer “;
$headers = “From: Way-BrightPools” . $_REQUEST['email'];
November 3rd, 2008 at 10:04 am
Hey, Everything looks good and seems to work, but once I hit submit its taking me to the thank you page, but I never get any of the emails. I tried a few different emails and none of them get any message sent. Please Help!!
November 4th, 2008 at 10:41 pm
Hiya
Great tutorial really easy. One problem though I’m not getting a confirmation sent page, what have I not put into the code. Also same as alot of other people its going into my deleted email file - please can you advise.
Thanks
November 6th, 2008 at 11:49 pm
You guys are great.
I had a client who wanted a form immediately reading this tutorial I managed to create one chack it at http://www.exoticafricansafaris.com its working like magic
Kudos guys
November 13th, 2008 at 2:09 am
My submit button is a dead link. Everything is in the root folder on on the http://ftp. Any ideas?
November 13th, 2008 at 2:10 am
http://www.bonusproductions.com/ContactForm.html