Virtual Mechanics: Community Forums and FAQs
Virtual Mechanics: Community Forums and FAQs
Web General Discussion
E-mail form won't work|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Working Mechanic |
Would really appreciate some help. I've tried to follow the Virtual Mechanics tutorial on e-mail forms but my script (and possibly the mail address) doesn't work. The script I've put into a SendMail.php file is:
<?$ForwardTo=“mail.proventivesolutions.com.au”;$name=$REQUEST[‘Name’];$email=$REQUEST[‘EmailAddr’];$entry=$REQUEST[‘message’];mail($ForwardTo,$name,$email,$entry);header(“Location:Thankyou.html”);?> Following comments on the forum I've taken spaces out as this is typed in Microsoft word and clicked the plain text box. The site is proventivesolutions.com.au . Many thanks. |
||
|
|
Working Mechanic |
G'day.
I am in no way a pro with script, actually I'm not even close to being good at applying it, but I thought I would have a look any way. So I took a look at your code and I noticed in line 79 of your code that the href attributes destination address is unusable, I highlighted it in red in the code snippet from your page below. /*************************************** *<div id="Oobj741"> *<a href="http://www.mail@proventivesolutions.com.au/SendMail.php."><img name="Ggeo536" src="./geometry/obj741geo536shd83pg5p14.png" alt="" border = "0" width="382" height="373"></a> *</div> ***************************************/ I don't think this is a proper destination URL, I don't think it should have the '.mail@' in the address, the address should just be a normal destination URL e.g. href="http://proventivesolutions.com.au/sendmail and so on. You might need to change this. Now I could be completely wrong but I thought I would tell you my thoughts any way. Good luck. Tonga. |
|||
|
|
Working Mechanic |
Tnks Tonga, but whatever the blindingly obvious I'm doing wrong is still happening. I've amended the address but no go. The Tutorial on Using Forms shows "Forwardto="someone@somewhere.com" and even without "someone@" I'm nowhere. There's a link/button/script not tweaked right. But blowed if I can work it right.
Have one on me anyway Byways |
|||
|
|
Honorary 'Aussie' Mechanic |
Like Tonga, I’m no expert either. But I have picked up a couple of errors.
Firstly, your “ForwardTo” is not a valid email address. It seems to be your server’s incoming mail setting. The “ForwardTo” should be something like “$ForwardTo=myname@proventivesolutions.com.au" As far as the rest of your code, I’m not real sure. I haven’t had the time to check it out. But, as Tonga says, the other link is certainly not valid. My second recommendation is to add PHP to the opening tag. Most servers will not recognize a PHP script with the opening tag of <? They require <? php I know it sounds finical, but I do know that my server requires the “php” to be there. Terry |
|||
|
|
Working Mechanic |
I had problems to, grab yourself a copy of forms 2 go it creates scripts for you, it got me out of trouble.
|
|||
|
|
Working Mechanic |
Hey Byways.
If you just need a simple contact form that's easy to use, I use 'google docs' it's part of 'google apps' to see a vid on it click here. I've tested these forms and they work great, all you have to do is 'join google apps' for free. Then you can make the forms and embed them in your site, when a user submits the contact form it automatically gets put into a spread sheet for you, with the time ,date and information. Embedding the forms is a piece of cake, when you've made the forms you just copy and past the code into the code editor is SiteSpinner and place it on the page where you want it to show. I can help you with all these steps, if you want me to just let me no in a reply. To check out or join google apps click here. Good luck, Tonga. |
|||
|
|
Honorary 'Aussie' Mechanic |
With all due respects to Crows and Tonga, you can design your own form in SS as you wish quite professionally without third party assistance.
All you need is the correct script to handle the form, which is what ByWays first query is about. |
|||
|
|
Working Mechanic |
Thanks for the comments and help, but my hole seems a lot deeper. I agree with postyr, all I was trying to do was to use the SS tutorial, though in desperation may have take Crows advice and paste in (though not sure I can do that right either!!). I like the Google site Tonga raised and it suggests to me some mouseovers could be added, but I don't want to link to something outside my website if possible. I've taken postyr's advice but there's something basically wrong in how I've followed the SS tutortial. My script is now:
<?php$ForwardTo=“mail@proventivesolutions.com.au”;$name=$REQUEST[‘Name’];$email=$REQUEST[‘EmailAddr’];$entry=$REQUEST[‘message’];mail($ForwardTo,$name,$email,$entry);header(“Location:Thankyou.html”);?> But in the test I don't get my "Thankyou" page, and in my webpage can't be found on "send". Where do I go from here? Appreciate your advice. Byways |
|||
|
VM Staff![]() |
Hi Byways,
You should be able to get the script supplied with the SiteSpinner tutorials to work. It might take a bit of work to get it initialy setup, but once you have done so it should work, and give you the knowledge to build more whenever you want. A couple of points - remember that your server is case-sensitive. So, if your page is thankyou.html, then having Thankyou.html in the script will not find it. Also, be sure that you have created a thankyou.html page in SiteSpinner, and Published it to the appropriate directory. - Derry |
|||
|
|
Guru 'Geezer' Mechanic |
In your Contact Page form, you should change your Send Mail button from a plain button type to a submit type. This way you do not need to worry about adding onclick code to the button; let the form work for you.
Re-open your PHP script in Notepad, not Word and verify that it is a plain text file. I have seen problems when using Word and saving in plain text as Word knows of at least 3 plain text formats. Notepad will result in a file format that is compatible for scripts. In your script, the line: is not correct. The mail function parameters are: mail(to, subject, message, headers);Your $ForwardTo is correct, but you are using $name as the subject (maybe you meant to). But the $email is being sent as the message body and the $entry is being interpreted as mail headers, which is going to cause you problems. Try this instead: mail($ForwardTo, $name, $entry, "From: $email"); When I click your Send Mail button, I get a Not Found error. This indicates that the SendMail.php script is not on your site, or if it present, it is not in the root directory as specified in your form's Action field. You may need to use either a 3rd party FTP program to upload the script or see if your account's control panel has an upload function you can use. |
|||
|
|
Honorary 'Aussie' Mechanic |
Larry may be able to correct me here, but I also think there are three other errors in your code where an underscore has been omitted.
Each entry of $REQUEST should read $_REQUEST I also just did a quick search for "Thankyou.html" and it doesn't exist. This message has been edited. Last edited by: postyr, |
|||
|
|
Working Mechanic |
Thank you all for your good guidance and advice. I believe now that the SS tutorial is flawed and unworkable - at least for a novice like me who does not work in HTML, and the challenge is not just your kindness and patience in helping a novice like me but - importantly - getting the SS Tutorial adjusted (refer to "Using Forms")so its easier for novices not understanding or working in HTML to get it right. Derry was correct, there was a case sensitive error in the "thankyou" and this is rectified in the script below to align with the website page. The script continues to change to (hopefully) follow the advice you wish to give (such as use of_ for script spacing when writing in microsoft, ?phpmail at the start, and amending code errors). The script is now as follows, but now also won't upload to the website with the rest of the files (this is new):
<?phpmail($ForwardTo,mail@proventivesolutions.com.au$name,$entry,”From:_$email”);header(“Location:_thankyouhtml”);?> The advice about using Notepad suggests I know something about HTML. I don't and I couldn't understand the file (SS is promoted as a web building product which does not require HTML expertise, though obviously it helps). I've kept with importing the microsoft SendMail.php file to the root folder via Foreign Object in Publish File format (this is an SS "Using Forms" Tutorial option) rather than uploading via a separate FTP management system such as FileZilla or Core FTP lite because other novices may not have got to the stage of understanding the benefits of this option and may still be completely relying on the SS tutorial and software. What do you think? What should I do now to get the SS based e-mail to work? Really appreciate your advice. Byways |
|||
|
|
Guru 'Geezer' Mechanic |
Using the Publish File type is a good way to get the script file uploaded to your site.
SS is basically a web page building tool. It is not designed as a one-stop cure-all. While it allows you to use scripts (both client side and server side), it is your responsibility to ensure those scripts actually work. SS has no built-in facility to verify your scripts are error-free. Your latest version of the script still contains errors. I think you will find the following code to be what you want: <?php
$ForwardTo = "mail@proventivesolutions.com.au";
$name = $_REQUEST['Name'];
$email = $_REQUEST['EmailAddr'];
$entry = $_REQUEST['message'];
mail($ForwardTo, $name, $entry, "From:$email");
header("Location:Thankyou.html");
?> Please ensure that the name of the thank you page used in the script is the same as your published page. The name used in the script and the one published via SS must match exactly including case.
|
|||
|
|
Working Mechanic |
Thank you Larryd for taking the time to clean up the script and realigning the scripting back to (nearly)what is sought in the SS Tutorial "Using Forms". Whatever the blindingly obvious I'm not doing right continues. Your script was placed into Notepad++ and saved as a non microsoft document (SendMail.php). I tested the file both within the SS project and then FTP uploaded onto the website (the 2 options) and both resulted in ongoing failed connections.
In terms of my responsibility to get the scripts right I would make the observation that Site Spinner's promotion states it can "Create sophisticated Web sites with no coding necessary". I chose SS because I thought it the most flexible and best option without the need to get involved in html coding, and I think this tutorial is the exception to that rule. I have tried faithfully to follow the tutorial and MANY days have been spent struggling and rechecking to achieve this. To have an e-mail that works is CRITICAL for virtually any website business I can think of, and in effect three months website work is now at a standstill. I feel gutted. I fare no better in understanding WebFormDesigner (just paste the script.....yeh). Like all newbies I don't know what I don't know, hence the search for advice (and a better tutorial). It seems I've come full circle - in search of that advice. Byways |
|||
|
|
Honorary 'Aussie' Mechanic |
Byways,
You sound very upset, or at least very frustrated (I hope it’s the latter) with Site Spinner. Their claim that “no coding is necessary” is correct, as they are referring to HTML coding. PHP is not HTML. It is a sever side code that integrates with your HTML code, and requires a completely different learning curve. There are some web hosts that do not support PHP, and there are others that will not allow you that support if you are on a smaller budget plan with them. However, I am assuming you have checked this out and that your plan and host does allow you the use of PHP, so please be patient while we try and help you out. We will start from scratch. Some of the points I will make in this post have already been mentioned in this thread, but you haven’t seemed to follow the advice. First of all, Larry’s script will work fine, and is in exactly the same format and syntax as in the tutorials. The only difference is the php after the opening <? tag. That is not Site Spinner’s fault, as some servers will accept that, but if your server uses later versions of PHP, it is generally recommended to use it. I have checked your Contact page, and all of Larry’s form object names are correct, but you have not followed his earlier advice. Your form button is still a “Button” type with a link on it. On top of that, you have three links to SendMail.php where you only need one. The first instance is a link on object obj741. If that object is not needed, delete it, or at least remove the link from it. The second instance is on the form’s action. Here you have placed the entire URL for the script. That’s not required. If the script is in your root folder, you only need the file name itself, SendMail.php. Even then, it still won’t work because the “Button” needs to be changed to the “Submit” type. The third instance is a link on the form’s button. Remove that link and change the button to Submit as just mentioned. Now all you need to do is to make sure both the PHP file and the Thank You page are in your root directory. If they aren’t, you will need to change the references in both the form’s action, and in the script itself. The script must be there, because if I enter http://www.proventivesolutions.com.au/SendMail.php into my browser, I get the 404 error as follows The requested URL /Thankyou.html was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. The first part obviously means that your thank you page is not in your root directory, or has not been uploaded. The second part I’m not real sure about, but I think it means that you do not have an error catch in your PHP script. For instance, if you click the link below to a PHP file for one of my forms, it will take you directly to an error page, because the script can’t find any data. http://www.tratcliffe.com/contact.php You seem very close to gettting it all together, and I sincerely hope we can all help you to get there. Terry |
|||
|
|
Working Mechanic |
Thank you postyr for your words of encouragement and advice. The strength in using Site Spinner is in its tutorials and the experience, insight, and advice within the forum. Indeed I was frustrated in setting up mail using the more generic Form tutorial(s). For a newbie there's not just one baby step per tutorial to cope with here, rather three: Form set up (with Submit type button); HTML script (don't use WORD, get yourself a good HTML Editor); and linkages. A mistake in any one of these three steps and you fall over, with the combined three steps making it difficult to work out what is wrong. Otherwise, its been a great ride plus lots of supporting software to find and explore using.
I imported the SendMail.php into the project and tested the form with the result that it said "Can't find http://www.sendmail.php". Testing on the website there's no comment. You've mentioned root directories but I'm not sure what that means beyond what I've done. Is the SendMail.php file to be saved in some additional sense? The following changes were made before testing: > Form change: Button to submit type > All references to SendMail.php within the form have been deleted except for the mail form itself. Found the ghost obj741 and that's deleted. > Re uploaded to ensure that changes were on website plus the heading for Thankyou.html page is consistent with script. Confirm my Webserver is perl/CGI/PHP enabled. Appreciate the advice and patience to date. Where to from here? Byways |
|||
|
|
Guru 'Geezer' Mechanic |
Open your Form Editor to the Form tab and in the Action field, enter the name of your send mail php script. Make sure it is entered exactly as you have specified as the file name in the Publish File object. For example, if the Publish File name is SendMail.php, that is what you should enter into the Action field, not sendmail.php or Sendmail.php (do not add http:// or www. or any other URL stuff - just the file name).
Also, make sure you publish all pages of your project, not just the current page. I have tried several different variations of the name ThankYou.html (thankyou.html, Thankyou.html, thankYou.html) and I still get a 404 page not found error. If you cannot view that page directly from your browser's address box, then the PHP script will not be able to find it either. |
|||
|
|
Working Mechanic |
Thanks Larryd
SendMail.php added to Form's URL Action, and Encoding changed from text/plain to Application/x-www-###. Imported publish file SendMail.php to project and tested file with "Can't find C drive file.." response. Uploaded all pages to server website (excluding publish file since there's an FTP uploaded file there already) and tested: "Can't file page.." response. Makes you want to gurney Byways |
|||
|
|
Honorary 'Aussie' Mechanic |
You seem to be doing everything right (except that object obj741 is still there, with the link).
I feel fairly confident that your script is working. To test that theory, I just sent an email from your Contact page. We would all be interested to know if you received that email. Of course the message itself will read as your default, as you have it read only. As normal, I was taken to the 404 Error page that the “Thankyou.html” page could not be found. If you did get the email, the only real problem that remains is your Thank You page. As Larry and I have said, neither of us can locate that page. Can you go to that page direct in your browser, and paste a link to it here? I suspect that either the page has not been uploaded, or there is a spelling error, or even spaces etc. |
|||
|
|
Guru 'Geezer' Mechanic |
Please run the following test:
1. Open your project and add a new page named index1 2. Open a code object, and in the editor: a. Enter: <?php echo phpinfo(); ?> b. In the code editor Test Geometry Name box, enter TOPMOST (all caps). c. Save and close the editor. 3. Open the Page Editor to the Page Select tab, and change the HTML File Extensions setting from .html to .php and click OK. 4. Publish your project and with your browser, navigate to your site to this index.php page. You should see a listing output from the PHP processor of all your site's settings. If not, then you do not have PHP enabled on your site. Some hosts offer PHP, but it must be enabled via a control panel setting before it can be used. |
|||
|
| Powered by Eve Community | Page 1 2 |
| Please Wait. Your request is being processed... |
|

