Forum Moderators: phranque

Message Too Old, No Replies

Need help with simple form....

I can't get it to send an email, what am I missing?

         

bossmanty

2:47 pm on Jul 9, 2002 (gmt 0)

10+ Year Member



I can't get it to send an email, what am I missing?

Here's the link to the test form:
The Code is below for the problem I'm having...

[edited by: bossmanty at 4:25 pm (utc) on July 9, 2002]

BlobFisk

3:54 pm on Jul 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You are better off using some form of mail script, like a fromail (perl) or an ASP/PHP/JSP script, it's better practice and it ensures that the mail gets to you.

If you are with a hosting company they more than likely will have a cgi-bin available to you with some form of form-to-mail script ready for you to use.

bossmanty

4:02 pm on Jul 9, 2002 (gmt 0)

10+ Year Member



I've been using the form my host provides but I can't rearrange it to fit my page....

Knowles

4:08 pm on Jul 9, 2002 (gmt 0)

10+ Year Member



If you got to say [hotscripts.com...] ... you can get one that might be a little easier to customize. The way you are trying to do yours seems to be very hit or miss as to if it will work. I have had them where it worked on one site but a cut and paste onto another site it stoped working. As far as customization a JavaScript one may be what your looking for.

ps. you might want to take the link to the example down. They dont care much for using that. It would be better to replace it with the code.

Andrew Thomas

4:16 pm on Jul 9, 2002 (gmt 0)

10+ Year Member



I use CDONTS on Windows 2000 server? just do a search for CDONTS in google lots of examples and code

Marcia

4:23 pm on Jul 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's the code for the form, easier to work with than the link:

<table width="672" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="389" height="391"></td>
<td width="283" valign="top">&nbsp;<form name="email" method="post" action="mailto:recipient@example.com" onSubmit="return mailMe( this.form )" enctype="text/plain">
<P>Are you without a Will?
<BR><INPUT TYPE="RADIO" NAME="without_will" VALUE="yes"> Yes
<BR><INPUT TYPE="RADIO" NAME="without_will" VALUE="no"> No

<P>You need legal services for?
<BR><INPUT TYPE="RADIO" NAME="needed_for" VALUE="personal"> Personal
<BR><INPUT TYPE="RADIO" NAME="nowill" VALUE="business"> Business
<BR><INPUT TYPE="RADIO" NAME="nowill" VALUE="both"> Both
<BR><INPUT TYPE="RADIO" NAME="nowill" VALUE="na"> N/A

<P>Are you 18 years or older?
<BR><INPUT TYPE="RADIO" NAME="over_18" VALUE="yes"> Yes
<BR><INPUT TYPE="RADIO" NAME="over_18" VALUE="no"> No

<P>Full Name
<BR><INPUT TYPE="TEXT" NAME="fullname" SIZE="25">

<P>Email
<BR><INPUT TYPE="TEXT" NAME="email" SIZE="25">

<P>Phone
<BR><INPUT TYPE="TEXT" NAME="phone" SIZE="25">

<P>Best Time to call
<BR><INPUT TYPE="TEXT" NAME="time_to_call" SIZE="25">

<P>State or Province
<BR><INPUT TYPE="TEXT" NAME="state_prov" SIZE="25">

<P>Legal Problem:
<BR><TEXTAREA COLS="30" ROWS="5" NAME="comments"></TEXTAREA>

<P><INPUT TYPE="SUBMIT" VALUE="Submit Form"> <INPUT TYPE="RESET" VALUE="Clear Form">
</FORM></td>
</tr>
</table>
</body>
</html>



The first problem is right here with this line, the "action" line in the form:

<form name="email" method="post" action="mailto:recipient@example.com" onSubmit="return mailMe( this.form )" enctype="text/plain">

Once you say method="post" it'll look for a cgi script, so it would have to be

<form name="email" method="post" action="/cgi-bin/somemailscript.cgi">

In the case of a *nix hosted site, there would be most likely a Perl script in the cgi-bin configured to point to where the perl interpreter and the sendmail program are. Very simple, and there are loads of scripts available.

Then any form on the site will work with that script. It's done server side, so it doesn't depend on whether the site visitors' service supports a simple mailto form or not.

Marcia

4:57 pm on Jul 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



From a working form:

<form name="INQUIRY" method="post" action="http://www.example.com/cgi-bin/scriptname.pl">

<input type="hidden" name="recipient" value="name@example.com">
<INPUT name="subject" type="hidden" value="Appears as Email Subject">
<INPUT name="required" type="hidden" value="email, name">

<INPUT TYPE="hidden" NAME="redirect"
VALUE="http://www.example.com/thanks.html">
<INPUT TYPE="hidden" NAME="missing_fields_redirect"
VALUE="http://www.example.com/error.html">

***THE FORM FIELDS GO HERE, WITH THE INPUT FIELDS***

<INPUT name=Submit type=submit value="Submit inquiry">
<INPUT type=reset value="Clear Form">

That's just a standard formmail.pl script with the name changed.