Computing.Net > Forums > Web Development > Email Form Q:

Email Form Q:

Reply to Message Icon

Original Message
Name: cambo (by gcambo)
Date: March 15, 2005 at 00:01:02 Pacific
Subject: Email Form Q:
OS: XP
CPU/Ram: Extensa 2000
Comment:

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>


<TR>
</TR></TBODY></TABLE>
</DIV>
<center><INPUT TYPE="submit">
<INPUT TYPE="reset">


Report Offensive Message For Removal

Response Number 1
Name: fambi
Date: March 15, 2005 at 00:15:37 Pacific
Subject: Email Form Q:
Reply: (edit)

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.


Report Offensive Follow Up For Removal

Response Number 2
Name: Michael J (by mjdamato)
Date: March 15, 2005 at 00:18:04 Pacific
Subject: Email Form Q:
Reply: (edit)

I see several problems.

First,

Some of the field names are not proper:
name=Phone=Number
name=Phone=Number

If 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


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Email Form Q:

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software