|
Page 2 of 3 Basic Form Set-up with FormMail One drawback of using the server-wide FormMail script, is that you must send the contents of the form to an address that is on your domain name. If for, for some reason, you need the mail sent to an off site email address, you can set up an E-Mail Forwarder to forward any mail to a particular address to your off-site email address. You would then use the forwarder address as your recipient in your form.
If you already have scripts that utilize formmail, you will need to change them so that the ACTION parameter in the FORM tag to read as /cgi-sys/formmail.pl.
All you need to setup formmail, is to create your form. A very simple form might look like: <FORM NAME=test ACTION=/cgi-sys/formmail.pl METHOD=POST> <INPUT TYPE=hidden NAME=recipient VALUE=
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
> Enter your Name: <INPUT TYPE=text NAME=name><br> <INPUT TYPE=SUBMIT> </FORM>
The only real requires in order to get FormMail to work properly is the ACTION=/cgi-sys/formmail.pl and <INPUT TYPE=hidden NAME=recipient VALUE=
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
>. Where
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
is an email address you have set up on your domain.
Another example of FormMail, which utilizes more of the special features is listed below: <FORM NAME=test ACTION=/cgi-sys/formmail.pl METHOD=POST> <INPUT TYPE=hidden NAME=recipient VALUE=
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
> <INPUT TYPE=hidden NAME=subject VALUE="This is a test form"> <INPUT TYPE=hidden NAME=redirect VALUE=http://valuetech.com/redirect.html> <INPUT TYPE=hidden NAME=required VALUE="email,realname"> E-Mail Address: <INPUT TYPE=text NAME=email><br> Name: <INPUT TYPE=text NAME=realname><br> Favorite Color: <INPUT TYPE=text NAME=color><br> <INPUT TYPE=SUBMIT> </FORM>
In this example, you will notice the same ACTION=/cgi-sys/formmail.pl and <INPUT TYPE=hidden NAME=recipient VALUE=
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
>. There are other INPUT TYPE=hidden types are are listed below: - subject -- This defines what you want the subject of the email to be. Be sure to use the quotation marks if it is more than one word.
- redirect -- This defines what page you want the visitor to be taken to, after successfully completing the form. You will need to specify the full URL.
- required -- The parameter takes on a list of the required fields that must be filled out in order for the form to be processed.
- email -- This is considered a special parameter, because this is who the form will appear that it was sent from. This is useful, because in most email clients, you will be able to hit a Reply button and send a message back to this email address without having to type it in.
- realname -- This will appear along with the email parameter. Instead of the mail appearing to come from just the said email address, this name will appear to the email address. This allows for a more personalized touch when replying back to the address.
Again, these are not required to have a functioning form. The only requirements are that ACTION=/cgi-sys/formmail.pl is in your FORM tag and <INPUT TYPE=hidden NAME=recipient VALUE=
This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
> is listed below the opening FORM tag. The next page has some optional form fields and further description of these fields.
|