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!

If you were interested in going the extra mile, in terms of design for your contact form, please download our highly popular tutorial here:



| 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

378 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?

  148. Mine works fine at godaddy. Very happy with the ease of fortoemail. Sweet!

  149. I have followed your instructions exactly. Everything else works, except that I never receive anything in my email. I use Yahoo for my webhost. I called them today, and they say everything is working on their end. I described to them what I have done, and they said it sounds like I did it correctly. This is the last thing I need to do on my website. If you could help me solve this problem, I would greatly appreciate it.

    Thanks,
    Cheryl

  150. Thanks for this. Made my life easier today.

  151. When I hit submit I get the thank you page, but no email actually shows up. What did I do wrong? Help Please.

  152. Little more info to above post…
    I am working locally on dreamweaver, I have the correct .php file name ans when I click submit after viewing my webpage from dreamweaver a window flashes real quickly and disappears and the thank you page opens up saying it sent the email to my address-that is correct also in the .php code-but I do not get the email. The first time I tried this I got the email and I was getting the pop up window to save,open, close the .php file. I checked the box to not show this message again and added two more form text fields and now I do not get the emails. What do you suggest?

  153. Great help -
    One little quirk - In Firefox, the “Submit” button reads “Submit Query” - I think this comes off a little wonky, and I would like to fix it -

    Any ideas?

    Thanks,
    Kris

  154. When I hit submit I get the thank you page, but no email actually shows up. What shall I do?

  155. Ok so my form looks great but when i push submit i get 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); ?>

    so i know that the code is wonky but im not sure were, any one with a good fix

    Kenize

  156. I will try it.

  157. Has anyone figured out the “you cannot submit a blank form” error? That’s what happens when I hit the submit button. I think it was mentioned in a previous post but no solution.
    thanks in advance

  158. Wow! This actually works! I’ve been searching and searching all over the web for an easy-to-use tutorial like this! Thank you VERY much!!!!!!!!

    Now, if you could only email me to tell me how to centre AP Divs within a #wrapper or container!

    Again, thanks!!!

  159. Thanks for the code, i followed the tutorial but whe i hit submit it give me the following error,

    The page cannot be displayed
    The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.
    ——————————————————————————–

    Please try the following:

    Contact the Web site administrator if you believe that this request should be allowed.
    Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
    HTTP Error 405 - The HTTP verb used to access this page is not allowed.
    Internet Information Services (IIS)

    ——————————————————————————–

    Technical Information (for support personnel)

    Go to Microsoft Product Support Services and perform a title search for the words HTTP and 405.
    Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Setting Application Mappings, Securing Your Site with Web Site Permissions, and About Custom Error Messages.

    Please help me

    i really need this form to work.. here is a link to my page http://www.safindo.co.za/contact%20us.htm

  160. Great help, thanks: but I’ve only one request: If I can to extend this to cover a few other text fields, such as address, phone, fax, etc, can you suggest please what I need to add for that/each one?
    (I did already scroll through the replies above…)
    Many thanks,
    P

  161. I have the correct .php file name ans when I click submit after viewing my webpage from dreamweaver a window flashes real quickly and disappears and the thank you page opens up saying it sent the email to my address-that is correct also in the .php code-but I do not get the email. The first time I tried this I got the email and I was getting the pop up window to save,open, close the .php file. I checked the box to not show this message again and added two more form text fields and now I do not get the emails. What must i do ?

  162. I have done every thing accroding to the tutorial,but i dont get any emails.It doesnt give me any errors on the website when i send the comments,it only says your message has been send! What do you suggest?

  163. Thank you for the script. I had some difficulties making it work. It was looking for a SMTP address. I found the following fix at http://drupal.org/node/341969

    Add the following code to the top of your email script if your mail script continues to fail.

    // Please specify your Mail Server - Example: mail.yourdomain.com.
    ini_set(”SMTP”,”mail.YourDomain.com”);

    // Please specify an SMTP Number 25 and 8889 are valid SMTP Ports.
    ini_set(”smtp_port”,”25″);

    // Please specify the return address to use
    ini_set(’sendmail_from’, ‘ValidEmailAccount@YourDomain.com’);

  164. Hi.
    I have searched and tried every possible contact form on the net. But none of them ever worked.

    After almost giving up, I tried your tutorial. And it worked!

    THANK YOU VERY MUCH!

  165. This is a great script, is there any way that the redirect page can be manipulated to be centered on the page with a back button or text?

  166. Tnku so much dis helped me alot
    xx

  167. Has anyone figure out how to make this go to 2 emails rather than just one?

    $my_email = “youremail@domain.com”;

  168. Hey! thanx!! it worked!!!!

    bye!

  169. Hello

    Thank you for the tutorial, however i have made sure all the scripting is correct but when i click submit i get an error message

    “Error 403 - Forbidden
    You tried to access a document for which you don’t have privileges.”

    Could you please help me? thank you

  170. Great dude …Too simple.. i tried it and only in 5 min. i got my “Contact Me” page, ready to use..
    Thanks a lot dear..
    And for other READERS…
    u can add as many field eg. address, phone etc. as u want.
    just follow insert/form/.. in dreamweaver.
    I m using 6 fields in my form..
    Thank again…

  171. I wasn’t receiving email until I made sure the domain extension in the email was the same as the domain extension of the site. If you tell it to send to joe@blue.com and your form is on green.com then it may not work. But if it’s on blue.com it will. OK, that was stupid but hopefully helpful. :-P

  172. Hi Dan

    been trying this for the whole day, have created the form as said but on my local machine when I hit submit I keep getting a file download box asking me to save or open which it does open the original script in dreamweaver and I have posted this live but get Cannot find “http://www.butterflyphotos.co.uk/FormToEmail.php”

    message. It also mentions a DNS server error, is this something to do with my host. I look forward to a reply before I tear my hear out and give up completly
    Thanks

  173. Hi,

    I downloaded your form and used it to the letter, but I don’t seem to be getting the emails. I get the “message sent” confirmed page but they don’t appear in my inbox.

    I use Yahoo! as my web host. I saw that others have run into this problem as well.

    Has anyone found a solution through Yahoo!?

    Thanks for your time.

    Randy

  174. Played with it for a couple of hours and got it to work for my job’s website. Thanks a ton! Keep doing what you do, cause it saved my bacon.

  175. I get the same error message as Amar c, once I click submit, i get a forbidden access message. thoughts anyone?

  176. I put the code in correctly and uploaded everything including the PHP file to my server. When I click on submit, nothing happens at all. It doesn’t even appear to be trying to load or get anything. What have I done wrong?

  177. Jeanie Tallis Says:

    For your email, choose a hotmail email. Certain email hosts wont work. You will have to register your own email and do it that way.

    Hope this helps all you that cant get it to send email.

  178. Jeanie Tallis Says:

    also, I have certain problems, when I recieve the email it comes from ‘Unknown sender’ how do I change it so that the email address typed in the ‘your email address’ box is the one that sends it, also. how do I change the subject.

  179. Jeanie Tallis Says:

    jeanie-tallis@live.co.uk
    if any of you are experiencing problems with this code. Please add me, Ill help you out.

  180. Jeanie Tallis Says:

    I found this on another website, it comes in handy. Design your form. Eg:
    Name
    Email
    Submit. They should code out as follows (if not exact, be careful but you can change the code)

    //Name

    //Email

    //Submit

    (Then underneath Tag put)

    $email = $HTTP_POST_VARS[email];
    $mailto = “email@address.com”;
    $mailsubj = “Form Subject Here”;
    $mailhead = “From: $email\n”;
    reset ($HTTP_POST_VARS);
    $mailbody = “Values submitted from web site form:\n”;
    while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= “$key : $val\n”; }
    if (!eregi(”\n”,$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }

    Its not the best code, but its good if you cant use the above.
    Not all email addresses work, due to server access. Though, I know hotmail/live/msn works.

  181. Jeanie Tallis Says:

    oops sorry for above it came out wrong :o Email jeanie-tallis@live.co.uk if you want the full code. Ill email it. Thanks

  182. Suhhhhwwwwweeet. Got this all to work on my website. It’s very user friendly in my opinion, and I’m having no troubles adding text fields in the HTML form and having them sent to me.

    I’m also using GoDaddy.com and they were very helpful in setting my hosting setup to be able to use .php like this AND .asp.

    Thanks a lot!

  183. the script works great! easiest thing i ever installed, seems like. nice job on the tutorial.

    however, i have a concern that i read about in another tutorial that was not addressed here. does this script have spam safeguards? whats to stop a spammer from turning our email address that the message is sent to into a “bot”? doesnt there have to be a CAPTCHA functionality in order to prevent that?

    please advise ASAP. thanks!

  184. to be clear, i want to both avoid getting SPAM’d myself with incoming spam, and avoid my form being a catalyst to spammers spamming other people.

  185. Took me awhile to get it to work but I now have a comment page for each staff member and am having a great time figuring out how to format it all.
    THANKS!!!!!!

  186. For you Godaddy users. You must be using linux.

  187. It worked great! after renaming the PHP file “fromFormToEmail.php” to “FormtoEmail.php” and making sure that my form was also pointing to “FormtoEmail.php file not to “FormToEmail.php”.

    Thank you very much!

  188. can anybody help? thanks!

  189. Malibu Barnes Says:

    Have completed the form, but upon clicking “submit”, receive the following error:
    Method Not Allowed
    The requested method POST is not allowed for the URL /FormToEmail.php.

    What am I missing?

  190. This was super easy and I thank you! Worked like a charm and that was on the first try!

  191. Hi,

    I followed your instructions and tried testing it though i got the following error:

    Warning: mail() [function.mail]: Could not execute mail delivery program ‘C:\PHP5\sendmail\sendmail.exe -t’ in C:\Domains\zammit-law.com\wwwroot\FormToEmail.php on line 96

    line 96 refers to

    mail($my_email,$subject,$message,$headers);

    Can you please help me out?

  192. Hello everything seems o be working great but when i hit the submit button i don’t receive it in my email have any idea why? oh and thanks a bunch:-)

  193. can anyone please give advice on adding captcha? thanks!

  194. IF YOUR CONTACT FORM DOESNT WORK HERE ARE SOME POSSIBLE FIXES:

    1. If you are getting a weird error, first make sure that in your code the action=”FormToEmail.php is spelt corredtly, in the tutorial it was spelt incorrectly which was action=”FormtoEmail.php (the t in to is lower case, should be upper case “T”)

    2. If everything seems to be working correctly but you are getting no emails. Your email domian name has to be the same as the domain of the site. Example, if the site is call http://www.AwesomeSite.com, the email hase to be “something”@AwesomeSite.com where “something” can be whatever you want but you have to have the @AwesomeSite.com

    3. If the site is giving you a link to Download the .php file that means your domain host doesnt support it and you need to switch over to the .asp version of the file.

    Hope that helps, and yes im awesome! lol =P hope I helped someone

  195. pradip chougule Says:

    good steps

  196. thanks for this tutorial

  197. Anthony Damiro Says:

    I just finished following the steps you providd and it looks good. I am testing it via dreamweaver. When I hit F12 IE 7.0 automatically displays the page in IE but when I hit submit (after entering information), I get the following ‘Do you want to save this file’ I will be hosting my page on Yahoo small business, and the support PHP.

    Also, I will like to know where in the folder do I need to save the php file (Root Folder or sub folder)?

  198. Eric Dixon Says:

    Thanks for the tutorial. when I hit the submit button I get this message:
    Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for eric@daystaronline.net in C:\xampp\htdocs\DFC\FormToEmail.php on line 11

    Thank You
    Your Message has been sent.

    Any help would be greatly appreciated thanks

  199. The directions are wrong! It says: “In the Action text box type in FormtoEmail.php.” But you must actually use the CAPITAL T or it won’t work. You must type FormToEmail.php then it will work great. Can you fix this in the instructions please? Thanks and great job on the script.

  200. Thanks, it helped. But what is a FormToEmail.php? I’ve never heard of it before, and I can’t figure out what it is just from this.

  201. i have made my form useing this tutorial but i wanted to insert some check boxs into it aswell im fine with doing it in the dreamweaver 8 and have made the form now but i dont have a clue how to edit the formtomail.php script to allow this could some one help just to were to place the lines of code in the script and if possible the code i would need to put in there would be great to see what im trying to do visit http://www.etesia.co.uk/ContactForm.html

  202. Is there any way to make sure you’re not getting spam? I read through the first comments but there are a lot so maybe this already got answered but.. I was thinking maybe adding a field that asks a yes or no question just to make sure a human is typing the email? Just wanted to know if that is even a good idea, or that should even be a concern with contact forms?

    Thanks.

  203. This is a great tutorial! But how would I make the PHP page a popup after the use clicks submit?

  204. Tacha, I’m guessing your webhost doesn’t support webmail.

    Different webhosts come up with different errors,
    Jeanie-tallis@live.co.uk

    I shall help all you with problems all I can.

  205. We are hosted on GoDaddy and have gotten this to work.
    But i wanted to know if you can point me to an article about how to attach a file to the email being sent out?
    -Josh

  206. [...] A number of you have already added a form using Dreamweaver, but they are not yet fully operational. Today, we will go over a simple way to add functionality using the tutorial over at Dreamweaver Spot. [...]

  207. what does this mean?

    Warning: mail(): SMTP server response: 501 Your domain does not seem to be valid. Could not find MX record for your domain. in C:\Inetpub\vhosts\mydomain.org\httpdocs\FormToEmail.php on line 116

  208. Hi,

    I’m creating a new website for my Aikido class, and I was really having a hard time with finding out how to make the submit button work.

    Thank you very much! Your tutorial was easy to follow.

    Janice

  209. I get the error

    “You must enable referrer logging to use the form”

    whats this?

  210. have sorted issue.

    Switched on logging in opera.

    found this to help sort errors:

    http://formtoemail.com/support/referrer_error.php

  211. I found your tutorial and downloaded the php file. It was a great tutorial that was easy to follow.

    Unfortunately, everytime I click send, I get 404 file not found error message. I’ve have uploaded all the relevant files for this to work and changed the file name and checked that it all correct and it still does not work. I’m using IX web hosting. Is there a reason why this should continue not to work

  212. I love this script so much I actually bought it - worth every penny and then so more!!! The new version is even better than the original!! The commenting is awesome!

    I was wondering though, has anyone figured out how to send the email to addresses stored in a MySQL db table?

    I added the Require statements for the DBConn file, also I created the RecordSet and added:

    $my_email = “$row_RSdealerforms['dealer_email']“;

    Unfortunately that breaks it. Suggestions?

  213. PumaKing101 Says:

    It was a great simple tutorial which works, but there is one problem.

    When I check the email where the message was sent to, No email address from sender, No Subject Line. Why is that?

  214. Thank you!! After searching for HOURS on how to actually have my form e-mail me the submissions… your tutorial has allowed me to *easily* create a working form.

    Thanks again, I can rest now…

  215. Very nice…. but how can we add an image? please help thank you….

  216. I have added the files to my folder but my website is not live yet. I am just learning to create web pages in dreamweaver but do have some HTML experience. When I opent he web page on my local computer and try to submit it actually opens the .php file. Will the form only work once I get it on a live web server? Feel free to email me about this at jasons1012@hotmail.com

    Thanks,
    Jason

  217. hi,
    Thnx a lot…

    I tried your script. first it didnt worked, but after renaming the file as FormtoEmail.php it worked. :)

    The subject of the email comes as “FormToEmail Comments” - is there any way to change this subject of email??

    Thnx a lot once again :)

  218. Hi,
    Great tutorial although when I press submit it links to a page of script. Some one above said this maybe due to your host not supporting php although I haven’t loaded it up yet so it’s just local.

    What can I do?

    I’m a dreamweaver novice so I don’t no how to switch from php to asp. although that may not be the right thing to do.

    cheers

  219. Hi

    Thanks for the tutorial. I am trying to tie in my froms from my email server with the dreamweaver application . Do you know how to do this ? Or could you send me in the right direction?

    tnaks

  220. The easiest tutorial i’ve come across and it works! However, on one of my websites I’m getting this error after hitting “submit”: The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access.

    Can you help me out with this one?

  221. Followed step by step but not getting any emails??

  222. followed step by step but not getting any emails through??

  223. Thank you so much! Dreamweaver was being a pain with the mailto: function. This works much better! Thanks so much!

  224. Hi there, thanks for the great file and tut.
    For de people who says they only can donwload de php file…. This is because you first have to put everything online! (not local)… otherwise it will never work!

    Hopes this will help some of you!

    R.

  225. I had to twiddle around with your Form, but it works great. You forgot further instructions, as to the ’subject’ line in the email being received. Add item 11:
    Change $subject = “FormToEmail Comment” to = “your subject line” to clearly identify the incoming email message.

  226. Hi there, thanks for the tutorial - I keep getting an error message : “Error 403 - Forbidden You tried to access a document for which you don’t have privileges.”
    I have tried changing the case of the T in FormToEmail and checked my code - no luck. Can you help me out?

  227. Thank you so much! Best tutorial of all.
    I have only one problem, even if I left empty fields it will still send the mail.(something I dont want) What values should I change in order to avoid sending the mail with empty fields?
    Thank you again

  228. Did anyone work out what to do when the form is completed all that happens is the error message ‘you cannot send a blank form’ pops up (even though everything’s filled in.

    Any hints appreciated.

  229. I have a 405 error. It’s saying a programming error. I have converted it to asp because the package i have with the hosting company does support php. Please help

  230. Great stuff, many thanks for your help - would never have got there otherwise!!! :)

  231. I use network associates. No problem using any script

  232. Having major drama’s, have created a form as a Html( action = mailto:) However, doest do what i want it too do, I want to create a PHP form, so i followed this and when i tested it out when i hit submit it directed through to the pho file and asked to open or save??? so dont get it, I am doing something wrong?

    - I want my submit button to do three things 1) Clear the form, 2) Email the form 3) redirect user to a Thankyou page.

    I have done all the work in a html page, created the form added all relevant fields, it does email the form, however if i ask it to redirect user as a behaviour it doesn;t email the form,

    Can anyone help me?? Do i have to open a new blank PHP page and start all over again??Can i insert and use my existing template and just enter in the PHP code? Thanks

  233. After clicking submit, I get the error invalid email address, but it’s correct in the php file. Why is this happening?

  234. Hi,

    Managed to get the form to work with godaddy you just need a linux setup and rename the form gdform.php…

    but my problem is it seems to just stop working after a few days? it will send lovely and then i do another test the next day and i don’t recieve the message?

    Any ideas why it would just stop working after a few days?

  235. Hi,

    Thanks for the Tutorial.

    I am getting an error on pressing the submit button.
    “You must enable referrer logging to use the form”

    Can you please help me withthe fix?
    I am a newbee in this arena and not much conversant with codes.

    Regards,
    Amit

  236. Hey,

    So I’ve been trying to implement your form - it’s working alright in every way, however, blank forms are submitted without problem… it appears that it doesn’t work!

    Thanks,

    Doogie

  237. Has anyone figured out how to get the email address to show up when they submit the form? It shows as blank for me still. I’ve scanned through all the comments and haven’t found it.

    This form is great by the way! Thanks so much for the info!

  238. Hi. thanks for this form processing.
    one question: I wanna use this form for arabic characters. when i use this form, mail has sent contains just “???”.
    any idea?
    thnx.

  239. This was very helpful thanks alot!!:)

  240. Awesome man ! I have been mucking around with these hosted form-mail deals, and read some tutes for creating a ’simple’ contact form that were way too heavy for a php dunce like me. I can’t believe how easy your tute was. When I was testing and pressed the submit btn, I was for sure expecting an error, but it worked first time ! You rock !! :D

  241. Hi I am confused the form works, thanks..real simple.. but I get the following when testing it on line ..try it and see

    Notice: Undefined index: name in E:\domains\m\mrufc.co.uk\user\htdocs\FormToEmail.php on line 133

    same for line 114

    my website is on my c drive/docs and settings etc

  242. Hi,

    I tried your code and i keep getting an error message like the below one:
    Page not found
    The page you are looking for might have been removed,
    had its name changed, or is temporarily unavailable.

    ——————————————————————————–
    Please try the following:
    If you typed the page address in the Address bar, make sure that it is spelled correctly.

    - Click the Back button in your browser to try another link.
    - Use a search engine like Google to look for information on the Internet.

    ——————————————————————————–
    HTTP 404 - File not found

    Please advise on what am i doing worng.

    Thank you in advance

  243. Hi, I used this tutorial to set up a contact/enquiry page and although the basic page worked right off the bat, it took me a couple of attempts to modify it to what I wanted; now it is working properly and I am a happy bunny. Thanks very much

  244. Cool tutorial. Solved a huge problem for me!

    Everything works. I would just like the Thank You to be in the same template as the rest of my website.

    How do I do that?

  245. I LOVE THIS SCRIPT & Tutorial!
    THANK YOU THANK YOU THANK YOU THANK YOU!
    After three days 7 scripts, and a 30 min call with my host.
    This is the script that WORKED!
    I have a godaddy deluxe hosting account, and their script policy SUCKS! But this script works, any way. I think its because its php, and not cgi. godaddy has scripts, but if you use it it tags the email with the primary host account, and will only send to one email account. SO, if you have more then one domain their script defeats the purpose.
    I’ve used godaddy for 4 months as i learned about hosting, web design, and web mastering. Often, their policies, and misleading statements about their products have impeded my progress. Especially for a newbie trying to figure it all out. I am going to have to leave godaddy - even if it is going to be a pain in the butt doing so.

  246. Hi,

    When I tested this on the site it kept saying “You cannot send a blank form”.

    Any help would be appreciated.

  247. It wasn’t sending emails for me and then I realized I made a silly stupid mistake (had a extra “.com” in my email address). Once that was fixed it worked PERFECTLY.

    I can’t believe how simple this is. And I can style my forms however I want.

    I love you! You are a GOD!!!!!!!!!

    Thank you for sharing this tutorial and especially the PHP code. :)

  248. One question, though. Does anyone know how to make certain fields required? I have three fields I’d like to make required, but currently, there is only an error message for a blank form.

    Thanks!

  249. Hi Daniel,

    Great tutorial, it worked for me instantly! However, I’m wondering how to skip the page that says “Thanks, we’ve received your email, click here to continue” and go directly to a “thank you” web page I’ve built. Right now my users are directed to the php thank you page and THEN my own thank you page. I want to skip the php page.

    Any ideas?

    Thanks,
    Tim

  250. also, I’d like to customize the subject line from “FormToEmail comment” to “Photography Enquiry from [Name]” using the name field I created. I’ve figured out how to change it to “Photography Enquiry from” but I don’t know how to link to the name entered. Thanks!
    Tim

  251. Was getting asked if I wanted to download the php file now gettng this

    Method Not Allowed
    The requested method POST is not allowed for the URL /FormToEmail.php.

    ——————————————————————————–

    Apache/1.3.33 Server at http://www.crowns-psd.co.uk Port 80

    It get quite frustrating.

    Regards

    Rob

  252. Now it just asks to download Dreamweaver.

    Computers dont you love em

    Arrrgghhhh

    Will be mint if I can get it to work.

  253. I’ve just uploaded everything and I keeping getting a NOT FOUND (form url= http://www.neoistsynthesis.org/join.html) . I followed all the steps, everything seems to be where it should be, and it’s still not working. I’m on Bluehost.

  254. I was also getting the ‘file not found’ error msg. I had everything set up correctly.

    But after I set the permissions on each file, the form worked.

    In the FTP window, I selected the file and clicked ‘get info’ (I use Fetch). After selecting ownerships and permissions (allowing the files to be viewed and execute), it worked.

    I’m not on godaddy. I have a site there and will try the script on it. This worked on Earthlink.

    Nice script so far - thank you!

  255. God bless you. For all the 940 pages of my Dreamweaver 8, I was not able to figure this out. Then google brought me to you. Many thanks!

  256. The filename is case sensitive, the file FormToEmail.php has the word ‘To’ capitalized. For some reason this tutorial does not capitalize ‘to’ in ‘FormtoEmail.php’. Hopefully this helps those getting file not found errors.

  257. This worked very very well!!! FYI, to everyone who uses this tutorial, follow his step word for word and it works!!!

  258. I get this error:
    Warning: mail() [function.mail]: SMTP server response: 554 The message was rejected because it contains prohibited virus or spam content in D:\Hosting\4799446\html\contact\FormToEmail.php on line 116

  259. Hey guys. W’ve been trying to get a form on a website we are working on for quite some time. Right when we thought we finally did it, we got this after we clicked send….
    The requested method POST is not allowed for the URL /form-post.php.

    what does this mean? Did we do something wrong?

    Please Help!!!
    Jared

  260. WILLIAM HENRY Says:

    ERROR ENCOUNTERED :

    Method Not Allowed
    The requested method POST is not allowed for the URL /FormToEmail.php.
    ———————————————————-
    Apache/1.3.39 Server at “website_name” Port 80

    PLEASE HELP !!!

  261. When I click the submit button (while previewing) in the forum i get this in my browser Firefox can’t find the file at /J:/JBLSite/contact. Does anyone no why?

  262. thank you, this page was VERY helpful

  263. Everything was easy until the part when i went to test it. vansonleathers.com/ContactForm.htm when you click on submit button it brings me to the The page cannot be displayed. What am I doing wrong? Someone please help me.

    Thank You
    Heather

  264. Hi, I copied the whole tutorial into DW cs3 and uploaded to my server (MediaTemple) but when I test the form and click submit, nothing happens, the information stays the same and no email is sent. I checked the pages for typos but nothing, everything is good but the form doesn’t work :(

  265. hi there… i want my form in a table so it is properly aligned. however, all i get in my email box is a letter that says:

    submit: submit

    none of the date comes over!

    i’ve deleted and rebuilt, and now i don’t even get the continue page… can you look at my page and see what could be wrong???? thanks!!!

    louise

  266. Hi,

    First of all thanks for this tutorial.

    I’m making a website and 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 also the no emails arrived in my inbox..
    The action is the same as yours.
    I do not know what is the problem.

    Look forward to hearing from you.

    Thanks

    Tiziana

  267. thanks! works great

    I wanted to add in a autorespond email… not sure how with this script… any ideas?

  268. also, wanted to add.. not getting very good error handling… stray marks in the email field are being picked up, but blanks forms can be sent, form missing name… not sure why it not picking up these errors..

    FF browser, Godaddy linux hosting

  269. At first I could not get the form to work on my work DEV server which I found out is not set up to work php. I dropped the files onto my personal web site space and tested. Works perfect. I too have a few questions.

    Can you get it to have FROM email when you get submissions?

    Can you turn off the SUBMIT=Submit result or will that always just be there?

    Is there a simple way to have this info be collected on the server or is the email the final function?

    Thanks,
    -e

  270. Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

  271. Words cannot express my thanks for your script and tutorial. I’ve looked long and hard for something that works this well and so easily.

  272. Excellent step by step tutorial. thanks alot.

  273. Hi there,

    I’m testing on FF and Safari and the form is working although it’s not checking for a valid email / name / comment. If I click on the boxes but just leave them empty and press send it goes to the thankyou messae sent page - Does the php scrip include validation I thought it did - any tips on how to get this working?

  274. I keep getting the error:

    Warning: mail() [function.mail]: SMTP server response: 554 The message was rejected because it contains prohibited virus or spam content in D:\Hosting\4429413\html\FormtoEmail.php on line 116

    Any ideas? I’m getting the same error on http://www.brezelpower.com/order.html

    On another site: http://www.successtechniquesforteens.com/contact.html
    I keep getting “You cannot send a blank form” when submitting content.

    Any ideas for the two errors?

  275. I am not getting any errors, however it doesn’t seem to be actually sending the info to my e-mail. Triple-checked and the e-mail address is correct. I’ve been using dreamweaver for awhile now, never did this before. My website is through Yahoo. Perhaps they don’t allow third-party scripts?

    Thanks,
    Andrew

  276. I tried to use your contact form but it does not work. There is no image so you can enter the code - I guess that answers one of the questions I was trying to ask you.
    I was looking at buying the Learn how to create Killer Contact Forms. Does it teach how to make forms with being able to upload attachments and also including kcaptcha

  277. Any idea if you can send to multiple e-mail addresses? I copied the $my_email line and added other addresses, but it appears that the only address that receives the e-mail is the last address.

  278. Absolutely brilliant tutorial, explained very well and works a treat. Thanks very much.

  279. I am using the FormtoEmail script and it works fine. I am trying to figure out how to have the script take you “back” from the last web page you came from when you click on “click here to continue”. I have no problem putting in a URL, but I need the browser back command to run. I know it in HTML but not PHP, help and thanks

  280. i cant get the custom thank you page to come up after i submit. once i press submit on the form, it sends me to the default php thank you page. i would like to be directed to a special thank you page i created. can you please help with that.

    besides that, GREAT SCRIPT AND TUTORIAL, saved my life. you guys are great.

  281. Hi,
    I have a tip for anybody who is having trouble with the contact form. In the preference panel (when you click on the form tag) you have to set the Enctype to: multipart/form-data
    If you don’t do this you will get an error message that reads: cannot send empty form. I got the form to work fine, make sure the PHP file is in the exact same folder that your contact form is in.

  282. I just wanted to say THANK YOU!!!! This is such a good forum!

  283. Good tutorial.

  284. Okay, you’ve got a mistake on this tutorial:

    You are saying that we need to type in
    FormtoEmail.php
    for the form action.

    But the actual file name that we download and unzip is
    FormToEmail.php (capital T)

    Works now!

  285. Hi, I have just (reasonably) successfully uploaded Contact Form etc with the help of your tutorial - great stuff.
    I have installed it with a web page I had previously designed and all is well.
    My only query is that when I submit the form, I get a message viz: PHP Notice: Undefined index: name in D:\websites\losa510621\www\FormToEmail.php on line 133
    I have identified this “name” on line 133 of the php page but am not sure what I should be substituting in place of the “name” to avoid getting this message.
    Can you please adise?
    many thanks

  286. I’m not sure how secure this is but it worked like a charm. I’m happy :)

    I wanna say thanks.. like over and over again.
    …and bow.

    Okay, you got it!
    XD Cheers mate!

    …well, do you listen to Kurt?

  287. Things go well on small business yahoo site, but nothing is getting into the email.. Any ideas ? for yahoo small business host? has anyone figured theirs out?

  288. I run my site on my local machine.
    when I click submit the I am asked to open or to save the formtomail.php

    what I am going wrong?

    Shlomi

  289. Iam new with dreamweaver and php, I did everything but when I click on submit I got the page from php as a code not the thank you page, could some one help me with this

  290. Any solutions to Yahoo small business??
    It’s been almost two weeks…I’ve tried asp but they don’t support.
    I’m using dreamweaver too, and Submit goes through well, brings up the “THanks your message has been sent”.
    BUT nothing is being sent.
    Is there something to this form with Yahoo?
    Can someone please help me out. the code seems to work. but nothing is going through.

  291. is there some way to use this form to email to a yahoo account and not deal with the godaddy hosting issue?

    Great tut! thanks!!

  292. Very nice tutorial, thank you. Would you be so kind as to tell me how to bypass your “Thank You” page and go directly to my own? If you prefer not to divulge how to tweak your code I would be happy to pay for a version that allows this.

  293. For those who have problem with redirection, simple do this and it will do the trick, i use this after hundreds of attemps and then i got it right

    in the php file, go in line 126 and you will see meta tag, simply remove the old meta tag with this meta tag

    then save it and upload it, after hitting submit button , it wont go to white page of thank you, it will go the page of your desire,

    Have fun and also MANY MANY THANKS to DANIEL for this simple script, now which is more useful and easy to handle.

  294. For those who have problem with redirection, simple do this and it will do the trick, i use this after hundreds of attemps and then i got it right

    in the php file, go in line 126 and you will see meta tag, simply remove the old meta tag with this meta tag

    (remove xx with tt)

    then save it and upload it, after hitting submit button , it wont go to white page of thank you, it will go the page of your desire,

    Have fun and also MANY MANY THANKS to DANIEL for this simple script, now which is more useful and easy to handle.

  295. Hello,
    Thanks for this nice tutorial.

    I have followed everything as directed. When I hit the Submit button, it shows FormToEmail.php code.

    Please help
    Thanks

  296. I was wondering if there is a way to have the email address of the person submitting the form to show up as the from address in my inbox? right now it ends up as anonymous@mmm1409.sanjose14-verio.com

    If it could be the person’s real email that would be great.

    Thanks,
    JT

  297. How do I remove meta tag (xx with tt) as soody recomemded. I cannot find any xx on line 126.
    This what i have on my line 126

    What do I need to replace here so that it can go the page I want it to go.

    Thanks

  298. G’day,
    Worked like dream cheers mate, for a great script…Hey even added mandatory fields

    Cheers again,
    Marie

  299. Hi dude,

    Looks great but any many others I get a popup to download/open the php file. What to do?????

    Pls help!

  300. Thanks for this great tutorial!!!!
    I have a question, I created the contact form in a new page..but now I need to insert that form into an existing website in an specific place and I really don’t know how to.. Do I have to create an AP div? Can I just go to insert and add the contact form? Can anyone help me please.

    Thanks so much,

  301. Hi, thanks for the great write up, this is amazing. My only issue and it’s barely an issue is that when I did this on my home computer, the email sent just fine and it showed the email coming from the email I put in the box. But when I do it at work, the comes through as “unknown sender.” Does that have to do with our hosts (home is comcast, work is qwest).

    Thanks!

  302. The tutorial worked great. Thanks so much.

    From this foundation I’ll be able to make a more suitable form, but at least I know where to start.

    Again, thanks.

  303. Thanks for the tutorial
    Have followed th instructions however when i submit it redirects to my server ?
    What can i do

  304. Sorted Changed the Enctype to: multipart/form-data
    this works perfect

  305. everything works but i am not receiving any emails?

  306. Thanks so much! You saved me a ton of time and it works perfectly. I don’t even get how it works, but it does. Amazing.

  307. Thank you so much!!!! I finally got my form to work :)

  308. When I fill out the form on my site, I get the following error message:

    Warning: mail() [function.mail]: SMTP server response: 554 The message was rejected because it contains prohibited virus or spam content in D:\Hosting\5283546\html\FormToEmail.php on line 116

    Here is the site: http://www.napleswaterfronthistory.com

    What do i do?

  309. Followed your tutorial, it worked like a charm, thanks so much.

    I wondered if there is any way to automatically send a copy of the form information to the sender as well as to me?

    Thanks for your time.

    Simon.

  310. This is the error i get when i hit the submit button. Dont really know anything about php. also dont understand why its accessing something in the c drive… Please help me.

    Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay in C:\Inetpub\corewebmedia\FormToEmail.php on line 116

  311. Can somebody help me please??? I cant seem to figure out what I’m doing wrong.

    When I click Submit, this is what I get:

    The website cannot display the page
    HTTP 405
    Most likely cause:•The website has a programming error.

    More information

    This error (HTTP 405 Method Not Allowed) means that Internet Explorer was able to connect to the website, but the site has a programming error.

    For more information about HTTP errors, see Help.

  312. Just a heads up. GoDaddy is no longer using the gdform.asp, you would have to use ../_gdForm/webformmailer.asp
    Also, if you are hosting with windows you need to use the .asp file, with linux the .php file
    GoDaddy has a tutorial for both, but does not indicate the ../ before the _gdForm/webformmailer.asp, but you do need to use it otherwise you will get a File Not Found page.

  313. I have a problem like some others. When I want to send the message it want’s me to download the file FormToEmail.php! Why is that and how can I correct that?

    However, the tutorial is great! Many thanks Daniel!

  314. thanks this great
    I learned a lot from this contribution thanks again you are a god

  315. my way works 100% great

  316. My contact form is working

  317. THANK YOU very much! I needed to create a simple contact for a friend’s web site and this did the trick AND fast! The only thing I had an issue with was that I followed your instructions ~exactly~ and had a little issue. In 5. above, you state to “…In the Action text box type in FormtoEmail.php…” The file I downloaded was FormToEmail.php (capital “T” in “to”). I couldn’t get the form to work until I realized the small mistake and fixed it in the Action box. Now it works like a charm!

  318. Hi, I have implemented this script but get no emails to my inbox. I have checked and double checked that all files have correct spelling and in the right locations, but still no email delivered. Any ideas?

  319. I’ve just went through your tutorial and I have a problem, whenever I click the submit button with or without any text in any field I get a part of the php file printed and the Thank you, your message has been sent line.I’m a beginner so I might have done something wrong. The site is not up yet but wouldn’t it be normal to show something “normal” even offline?

  320. When I click ’submit’ my page does nothing at all…?

  321. Hi, Thank you for the tutorial. I did everything as you said. but when i click on submit it doesn’t actually send the email! could that be a web hosting issue? I got mine through yahoo..

  322. Hello Guru, what entice you to post an article. This article was extremely interesting, especially since I was yearning for thoughts on this topic last Thursday.

  323. Thank you! I have been under the impression that emailing through the website via dreamweaver would be very complicated. You made this so simple and my client is going to be a very happy camper!

    Let me know if I can donate to the cause (i didn’t see anywhere) I’ll be happy to.

  324. I keep getting the “You Cannot send a blank form” message even though i populated my form with data from the start so that even if they left fields blank there was still something there. Please help I see this question several times in this post with no answer.

    This is the page I’m working on
    http://www.royaltyinn.com/mapdirections.html

  325. After posting I relooked at your tutorial and noticed that I had a value in the encrypt section. Once I removed that the form worked beautifully. THANK YOU!

  326. I am working on my dad’s website and trying to add this to his website, I have come across one problem and can’t seem to figure out what is wrong. He has made a template through a WYSIWYG and I replaced a line of code in his Contact Us Email submitter. The only trouble I have run into that I can’t seem to figure out is when I click submit after filling out the form I get this…http://www.dailyfitnessandexercise.com/FormToEmail.php(URL) It says: You cannot send a blank form.
    How can I fix this?

  327. Very important:

    Remove the line in the php file “”

    and in your contact html page the form action line should read:

    Also note that although the tutorial states that form action should be FormtoEmail.php, the capitalization is wrong. Make sure the “t” is uppecase.

  328. Odd that the meta line didn’t show. Remove everything after meta http-equiv in the php file.

  329. Sheesh. the form action line should read

    form action=”FormToEmail.php” enctype=”multipart/form-data” method=”post”

  330. Has anybody else received this message? Please can you advise me on where i”m going wrong?

    Error 403 - Forbidden

    You tried to access a document for which you don’t have privileges.

  331. Thank you for the tutorial, worked! 1st time no promblems and was even able to editted the webpage more to my characteristics due to the easy notes you provided.

    Thanks

  332. for yahoo users or for people having trouble when it sends but you don’t receive anything I figured it out.

    In the FormToEmail.php page look for this code

    $headers = “From: ” . $your_name . ” \n”;

    either make it into a comment by adding this // at the beginning or just delete it all together.

  333. hello dan,

    i followed the above instructions.. after several attempts of clicking submit button the page will display “Email address is invalid”

    pls help thanks!

  334. Genius

  335. I am testing my website on my personal mac running the builot-in apache server. Is that why the mail doesn’t send?

  336. Hi, thanks for the tutorial. I used the FormToEmail.php file and it is working great and sending all the information on my form in an email as you said. I have tried to read the code but I can see where I can make a chnage but I would like for it to not put a blank line between each field it is printing out in the email. Below is an example of what it is doing.

    Last Name: Fogg

    First Name: Fred

    Address: 123 Any Street

    I would like for it to do this.

    Last Name: Fogg
    First Name: Fred
    Address: 123 Any Street

    Can you tell me what to change in the code to fix this?

    Also, for some reason, it is taking some of the text fields and coverting them to all lower caps. Any idea why it is doing this?

    Please email me back at NAFAWebMaster@n-a-f-a.com with your answers as I would love to get this fixed asap. These tutorials are great and have really helped me with our website. Thanks for the great tutorials.

    Fred Fogg
    NAFA Web Master (used loosely LOL)
    http://www.n-a-f-a-.com

  337. Great tutorial! I want all the fields on my form to be sent in the email, even if they don’t put anything in the field. With this code, it only sends the fields that have something in them. How can I fix this? Thanks!

  338. Ok, I fixed it so it sends all the fields on my form, but it is putting a blank line in between each line in the email, what part of the build message code in the FormToEmail.php file do I change to make it not put a blank line between each field? Thanks!

    If anyone knows, please post an answer here so I can fix this asap! Thanks!

  339. I’m just tickled to have found this! Once I changed the case issue on the FormToEmail file, it worked like a charm. After running through some testing basics, the only thing I noticed was that I get the “Your message was sent” page even if I left the email address blank.

  340. Those of you who want your submitter to receive a copy of the email, you can copy line 116:

    mail($my_email,$subject,$message,$headers);

    paste and edit so that the following is right below it:

    mail($_REQUEST['email'],$subject,$message,$headers);

    The $_REQUEST['email'] is the submitter’s email.

  341. Thanks for this!! I had to tool around a lot to make it work, but it finally does:

    1. Like others I had to change the lower case ‘t’ to a capital. It’s listed in the instructions as lower case (would save a lot of people trouble if you updated that)

    2. Had to create a filter to keep the email out of my spam.

    3. Never could get it to redirect to the page I designated after submitting, but it DOES redirect to the generic thank you message in the php file. I just edited that message and added my style sheets to the php file and that works fine for my situation.

  342. Hello Thank you for such a great script.

    I thought everything was working perfectly until I tried using it on Internet Explorer. Works great on other browsers 9firefox etc)but in IE , when I click submit nothing happens@! Im using it for a client, so if anyone can help me I would greatly appreciate it.

  343. it works guys_
    how do i custimoze the texfield ?
    in the php,i need to put more texfield
    like age and other question.where on php script i have to make the changes?

  344. this worked like a charm! i have been looking for something and this is the first that works!!!! AWESOME!!!

  345. Your instructions worked perfectly - and I will quote a poster “Genius”.

    There are a a few things I hope you can help with.

    1. I would like all the items to be required when a form is sent. When I press submit the blank areas are sent.

    2. The “from” part in the email box shows “unknown recipent”. Is it possible for it to show the senders email address when it arrives in a persons email box as oppose to “unknown sender”?

    thank you again for the great info.

    regards

    J

  346. My solution for the ‘cannot send blank page’ error was in the property of the form. The Enctype should be empty

  347. When I click the submit button I get a blank page and the URL
    is ……./FormToEmail.html/FormToEmail.php

    Why does it have the html file and the php file in the URL? It should just have the php file

    IS there a fix for this….Thank you

  348. never mind it works now…thanks

  349. Thanks for sharing this group of lesson learned, you have added a few points that I need to go away and consider.

  350. Thanks for the tut, but this does not work. It will ask you after submit if you want to open/save the php.
    Also i tried .asp but i can’t upload .asp to my server root.

    Bye

  351. Great tutorial! Worked for me! But it is only for beginners. Just browse other sites and you will see! Validation doesn’t work here, neither is there any security! Use this code only if you are a novice. If it works, then fine. Find another code (i’m talking to web designers out there).If it doesn’t work, it’s fine as well. Just keep trying. But don’t break your head trying to solve it. Browse other sources.
    Validation is important! Or ele someone can send a blank message accidently. It will be annoying to find a ‘noone’ email in your inbox.
    As for the tutorial, it is really great for beginners. Thanks a lot!

  352. Mine worked like a charm. Only problem I had was the “T” in “FormToEmail”. THat screwed me up at first, but after I fixed it, it was all good. My hosting server is IPage, and I have found NO problems with them =) Thank you for this tutorial, as I am really not in the mood to learn to in depths of the php. I know how to write a very short one, but this is something better. So thank you.

  353. netbook forum

    Gute Tests zum Bereich findet du auf http://www.netbook-community.de.

    Hab auf der Page sogar gute Tests über das iPad gefunden gerade das ist im Bereich netbook community ja ein richtiger Newcomer.

    Schaut es euch mal an viele hat dieses iPad überredet.

    so muss jetzt weiter

  354. A big thanks to you!!! Its working dude just keep leading us….. Just one thing i want to know if i receive any mail its show “UNKNOWN SENDER” can it change will it be remain the same… plz guide me…

  355. Hello, very much like your blog

  356. I have my formtoemail.php and my contact.html page working properly so that I am receiving the emails, however I would like to add the appropriate code on my contact.html page as well as my formtoemail.php so that the submitter will also receive a copy of the post in their email. I tried pasteing
    the following exactly as it appears below on lines 114-120 in my formtoemail.php page but it does not generate a copy to the submitter’s email only to mine.

    $headers = “From: ” . $_REQUEST['email'];
    mail($my_email,$subject,$message,$headers);
    if($form['submitted']['contact_me_by_email']['#value'] == ‘yes’){
    $form['submitted']['contact_me_by_email']['#value'] = $form['submitted']['email']['#value'];
    }

    ?>

    My goal is to allow the person who posts the comments to receive a copy also.

    Thanks,
    Patricia

  357. This was a great help!!

    For godaddy:

    You have to setup your forms email address in hosting first and use the following for the form action;

    form action=”_gdForm/webformmailer.asp”

    Also if you want to redirect to a page after submission add:

    and change yourpage.htm to the page you want your user to be redirected to after they submit the form.

  358. This was a great help!!

    For godaddy:

    You have to setup your forms email address in hosting first and use the following for the form action;

    form action=”_gdForm/webformmailer.asp”

    Also if you want to redirect to a page after submission add:

    input type=”hidden” name=”redirect” value=”thankyou.htm”

    and change yourpage.htm to the page you want your user to be redirected to after they submit the form.

  359. This was a great help!!

    For godaddy:

    You have to setup your forms email address in hosting first and use the following for the form action;

    form action=”_gdForm/webformmailer.asp”

    Also if you want to redirect to a page after submission add:

    input type=”hidden” name=”redirect” value=”yourpage.htm”

    and change yourpage.htm to the page you want your user to be redirected to after they submit the form.

  360. Hey Daniel you are great man. Its really works.. This is I have been looking for a longtime. Thanks u very very much for helping us..

  361. Thanks Daniel. This saved me a lot of time. So many other’s promoting their cheesy offers which wastes my time. You laid things out real nice. I did have to modify some code, but the nice thing is you show the entire code so it’s easy to set it up. Plus you are taking the time to answer questions etc. Again Thankyou!

  362. Hey, i came across your blog on google and i think it’s awesome!

  363. I followed your tutorial, when i click on send the following messages are displayed:

    server error
    500 - Internal server error.
    There is a problem with the resource you are looking for, and it cannot be displayed.

    I host with fasthost. Can you please help what do you think is the problem. How can i get it to show the thank you message.

  364. Hi there, i have followed all the instructions, my Hosting is through One.com, when i click the submit button nothing happens, no error message, no thing :(

    Does anyone know of any one.com issue, and what the problem might be?

    Kind Regards

    Sarah

  365. Hi, the form works great, but when I checked the source code on the form to email.php, there was a line of nasty code in there. It spread to the main site index.

    The code ISNT in the dreamweaver window, but when you are live on the page it is there and is very nasty. Just thought you should know…

    The code is about indepth insurance and google flags it up and knows about it.

  366. sir

    when i use this code or process after that when i push submitt button this link appear as Save file or open file,
    what is this i cant understand it, pleae reply me soon.

    shafqat

  367. Two issues.

    1) has anyone found a fix to the issue on the Thank you page that begins:

    64 || empty($exploded_email[1])){$errors[] = “Email address is invalid”;}else{if(substr_count($exploded_email[1],”.”) == 0){$errors[] = “Email address is i

    I’ve seen it mentioned a couple times but saw no specific solution.

    2) was there a fix given to the Firefox issue of “Submit Query” showing up on the submit button?

    Any help would be appreciated.
    Thnx

  368. Hi,
    I am learning dreamweaver now. I have followed all the instructions. The form seems to work but I don’t receive any email. It even redirects to the page I mentioned. I run it in the local server(iis). Any suggestions?\

    Thanks a lot.

  369. Hey Daniel,

    Thank you SO much for the super easy tutorial! It worked perfectly (once I called GoDaddy and they explained to me I had to use THEIR script), but the way you laid out the process familiarized me enough with the process and the coding it was a super easy fix. I’ve scoured the internet trying to find tutorials on this subject and every single one left me confused and Contact Form-less. I have finally created one and will know how to do so in the future! It was so much easier then they make it sound. Thanks again!

  370. Hi,

    Awesome Tutorial. One problem when i receive the emails it displays (unkown sender), is there anyway of changing this

    Thanks

  371. I figured out everything except when I get the email, it only has my last 2 fields. Can you tell me what I should check for in the code?

  372. Great tutorial! It works a treat and is really simply explained. Wonderful job thanks alot!

  373. URL NOT FOUND SOLUTION:

    I also kept getting file not found errors… my file on the remote server was titled “FileToEmail.php” with a capital ‘T’. changed it to a lower case t and it now works

  374. I want to know how to change the from field that appears in the email. Currently is shows as a mix of things including my hosting login name.

    Site I am working on is harrisentertainment.ca

    Im using Godaddy, and it is working just fine.

  375. Hi I´m from Germany and I nerver found anything like this..every thing works. I Love you

  376. I downloaded your Killer contact form Tutorial and have to say Thank You!! Your work helped me out tremendously. I would have never thought I could create a contact form so fast!

Leave a Reply