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.

Dreamweaver Page Title

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.

Dreamweaver Contact Form

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.

Dreamweaver Text Field

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.

Dreamweaver Text Area

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).

Adobe Dreamweaver Form

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.

Dreamweaver Form to Mail

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:

Adobe Dreamweaver Form to Mail

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.


| del.icio.us | Digg it | Furl | reddit | StumbleUpon | Yahoo MyWeb

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

AddThis Social Bookmark Button

Fireworks CS4 468X60

148 Responses to “Dreamweaver Tutorial - Create a Contact Form In Dreamweaver”

  1. Excellent! Thanks for the step-by-step. It looks easy. :)

  2. 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.

  3. 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…

  4. 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?

  5. Hey thanks This was easy and it helped me learn dreamweaver more.

  6. @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

  7. I’m practicing and learning dreamweaver and this tutorial was excelent, very simple and really works!

  8. 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?!

  9. Great Stuff. What I have always been looking for. Thanks

  10. 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

  11. 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.

  12. @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

  13. 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.

  14. @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

  15. 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?

  16. godaddy sucks! Says:

    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.)

  17. I am using GoDaddy and Having problems with them as well

  18. 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

  19. Dear Daniel,
    Its looks cool i done all but not yet uploaded.Will be posting result after upload.
    You are simple great

  20. 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!

  21. bharanidreamers Says:

    Great Stuff. What I have always been looking for. Thanks

  22. Dude it works. I had to capitalize the ‘T’ in FormToEmail but that was a quick fix and you rock.
    Stay coo.

  23. 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!

  24. 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:

  25. Sorry… the text in Dreamweaver looks like this.

    Name:

    Company:

    Email:

  26. [...] 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 [...]

  27. 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.

  28. 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.

  29. Awesome work !!!!

  30. Great tut, everything is working great. One question though. Is there a way to make the thank you message a popup?

  31. 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

  32. @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

  33. 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

  34. 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?

  35. 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?

  36. 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?

  37. 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.

  38. Thank you so much. It was very easy and helpful…

  39. 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

  40. [...] tutorial is from Dreamweaver Spot that give you info about how to create a PHP contact form for your [...]

  41. @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?

  42. 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

  43. You are my hero! It totally worked! Thank you!

  44. 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

  45. 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?

  46. @Casa

    This usually means that the server does not support PHP, contact their Tech Support and find out.

    Cheers
    Daniel

  47. I finally got the form to work, but after saying that it has been sent i dont receive anything :(

  48. 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!

  49. 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

  50. When I hit submit it tries to download the FormToMail.php

    my site is hosted on mac.com

  51. 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

  52. 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!!!

  53. uuuggghhh Says:

    this form to email thing is a damn nightmare…

  54. hi

  55. 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

  56. 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?

  57. doh! please disregard everything I just wrote…..I was looking at some other code….

  58. Zeljko Sakic Says:

    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

  59. 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.

  60. This is fucking outstanding! THANK YOU VERY MUCH. I was struggling until I hit this page. You’re my hero…for today.

  61. 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.

  62. I 2nd that. I can’t tell you how much i appreciate this.

  63. thanks man

  64. 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.

  65. Great stuff!! Thank you sir!

  66. I cant get this thing to work. tried 2 times. I use 1&1 and they support php

  67. Thanks Man it work great

  68. Ganiu Okulaja Says:

    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.

  69. Ganiu Okulaja Says:

    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!

  70. 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.

  71. Ganiu Okulaja Says:

    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.

  72. 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.

  73. 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!

  74. 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?

  75. 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

  76. 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.

  77. The Email wont work??/ :(

  78. 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?

  79. 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

  80. 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

  81. waterproof Says:

    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.

  82. 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?

  83. 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?

  84. works awesome.

  85. 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

  86. Thanks man this is an absolute charm!!! Thanks for sharing this tute with us.

  87. 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?

  88. 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?

  89. 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….

  90. 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!

  91. 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?

  92. Great stuff. Worked first time. Much appreciated.

  93. 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

  94. 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

  95. 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

  96. Oh, thanks man! I hate scripting and I have finally found the holy grail of websites to help ease my pain. Thanks!

  97. @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?

  98. 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

  99. 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

  100. 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?

  101. 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.

  102. *** 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???

  103. 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.

    :)

  104. excellent stuff. you make it so simple.
    thanks.

  105. 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.

  106. 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!

  107. 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

  108. 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?

  109. 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

  110. 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

  111. 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!

  112. 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

  113. [...] 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. [...]

  114. thanks this contact form works well for me
    very good tutorial thanks again

  115. what i done wrong?!…. when i press submit it gives me the download window for formtoemail.php:|…

  116. How can I make the fields required and remove the submit: submit in the emails?

    Thanks this works great!

  117. 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.

  118. 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

  119. 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 :)

  120. finally! i found a working tutorial! thnx dude!

  121. It works perfect my friend.
    Thanks very much.

  122. 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.

  123. 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

  124. 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!!

  125. 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

  126. I seem to get the following errors when loading the form as per tutorial

    Help anyone

    Thanks
    Shaun

  127. 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

  128. 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…?

  129. oh actually…
    I see “submit”
    I don’t get any subscriber’s e-mail address in my e-mail…

  130. !!!!!!!
    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!

  131. 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.

  132. Thanks mate - good tutorial!

  133. I thought creating a form was going to melt my brain. Thank you for making it so easy ;-)

  134. 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??

  135. thnks man….simple, easy….
    visit here http://www.hasrilhusni.com/contact.html

  136. 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.

  137. 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.

  138. Bryce (See April 18th, 2008 at 12:56 pm), capitalized the ‘T’ in FormToEmail solved the problem. Cheers.
    Thanks a lot Daniel!!!!!!

  139. 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

  140. 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.

  141. AMAZING… thank you so incredibly much!!

  142. 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

  143. 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'];

  144. 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!!

  145. 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

  146. 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

  147. My submit button is a dead link. Everything is in the root folder on on the http://ftp. Any ideas?

Leave a Reply