Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am tring to set up an Email form but it doesn't seem to send emails and I was wondering if someone could look at the code to give me a clue to what is wrong.
<BODY text=#000000 BACKGROUND="597.JPG">
<FORM METHOD="POST" ACTION="mailto:gcambo34@iprimus.com.au" enctype="text/plain">
size=1><CENTER>
Please allow up to 48 hours for us to respond to your reservation request. Please check our opening hours.</center><DIV>
<TABLE style="WIDTH: 660px; HEIGHT: 379px" cellSpacing=0 cellPadding=0 width=660
align=center border=1>
<TBODY>
<TR>
<TD width=216>
<DIV align=center> size=1>Required Date: </DIV></TD>
<TD width=484><INPUT maxLength=100 size=12 value="" name=Required=Date:>
</TD></TR></TD></TR><TR>
<TD width=216>
<DIV align=center> size=1>Required Time: </DIV></TD>
<TD width=484><INPUT maxLength=100 size=12 value=""
name=Required=Time: > <FORM METHOD=post ACTION="/cgi-bin/example.cgi"><INPUT type="radio" name="option"> am
<INPUT type="radio" name="option" CHECKED> pm
</TD></TR></form<TR>
<TD width=216>
<DIV class=text align=center> face="Verdana, Arial, Helvetica, sans-serif" size=1>Number Of People:
</DIV></TD>
<TD width=484><INPUT maxLength=100 size=12 value="" name=Number=Of=People:>
</TD></TR><TR>
<TD width=216>
<DIV align=center> size=1>Your Name: </DIV></TD>
<TD width=484><INPUT maxLength=100 size=50 value=""
name=Your=Name> </TD></TR><TR>
<TD width=216>
<DIV align=center> size=1>Phone Number: </DIV></TD>
<TD width=484><INPUT maxLength=100 size=16 value="" name=Phone=Number><small> (Include Area Code)
</TD></TR><TR>
<TD width=216>
<DIV align=center> size=1>Mobile: </DIV></TD>
<TD width=484><INPUT maxLength=100 size=16 value="" name=Mobile> </TD></TR><TR>
<TD width=216>
<DIV align=center> size=1>Business:</DIV></TD>
<TD width=484><INPUT maxLength=100 size=16 value="" name=Business><small> (Include Area Code)(Day Time Hrs) </TD></TR>
<TR>
<TD width=216>
<DIV align=center> size=1>Fax: </DIV></TD>
<TD width=484><INPUT maxLength=100 size=16 value="" name=Fax> </TD></TR><TR>
<TD width=216>
<DIV align=center> size=1>Email: </DIV></TD>
<TD width=484><INPUT maxLength=100 size=30 value= ""name=Email> </TD></TR><TR>
<TD width=250>
<DIV align=center> size=1>Additional Information:</div>
<TEXTAREA NAME="comment" ROWS=6 COLS=24>
</TEXTAREA></TD></DIV>
<TR>
</TR></TBODY></TABLE>
<center><INPUT TYPE="submit">
<INPUT TYPE="reset">

To be honest with you, i've never seen an email sent like that before.
Usually, what i have seen is that a form passes the details to another page, which retrieves the data and converts them into an email.
But i'm not very experienced.
If you're interested in SMS, visit section about sms news.

I see several problems.
First,
Some of the field names are not proper:
name=Phone=Number
name=Phone=NumberIf you want to have a space in a form field name, you need to enclose it in quotes. In fact, you should always do this to be compliant. (i.e. name="Phone Number"). However, many programmers do not use spaces in variable names as a rule.
Second, you have two opening form tags before the first form closing tag - both of which have different actions. One action is an email address the other is a CGI script. Which one do you want to use? You cannot nest forms like this. You must close a form before you open another. Plus, you first (and only) closing form tag has no closing greater-than sign and it comes after teh first for field (option). All of the rest of the form fields are not within a form!
The advice I always give when creating forms for beginners is to create a form with only ONE field and no extraneous content on the page. Get that to work, then start adding your content and other fields.
If you do plan on using a CGI script, you will need to look at the instructions for that script. Many require hidden fields ont he form (such as the email address to send the data to). Usually, you can just download the CGI script to your computer and open it in notepad - the directions are usually included in the script.
Michael J

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |