Lunarpages Web Hosting Forum

Author Topic: Working CGI FormMail  (Read 1215 times)

Offline scroundy

  • Spaceship Captain
  • *****
  • Posts: 100
    • Roundbook.com - Connect and Share with Family and Friends
Working CGI FormMail
« on: June 11, 2003, 10:51:37 AM »
I just got a formmail script to work really well last night.

I got it at http://www.hotscripts.com/Detailed/10680.html

It was suggested to me by lunarpages support. If you want to try it, then let me know. I'll help you out.

Basic idea is to have 3 files. allowedRecipients.txt, FormMail.pl (this is what you get from hotscripts), and then your Form.html file. Make sure that allowedRecipients.txt has 777 permissions (and put the addresses that the form is allowed to send to you@yourdomain.com), and FormMail.pl should be executable by everyone (755, I think). Then just put the path of your allowedRecipients.txt file into the FormMail.pl $recipients variable.

Your form.html (or whatever you want to call it) needs the action cgi-bin/FormMail.pl and then the hidden inputs determine everything else.

Offline snickn

  • Jabba the Hutt
  • *****
  • Posts: 543
    • http://www.snickn.com
Working CGI FormMail
« Reply #1 on: June 11, 2003, 10:56:27 AM »
harmspen, you are making me feel quite crazy...:P

I responded to your post elsewhere, then it was gone...

If you could fix the link though, it should be :

http://www.hotscripts.com/Detailed/10680.html

That one you use above comes up 404 for me. (and I'd assume everyone else) but knowing hotscripts, it just needs to be in the /Detailed/ dir.

Thanks, and cheers.
nick

Offline scroundy

  • Spaceship Captain
  • *****
  • Posts: 100
    • Roundbook.com - Connect and Share with Family and Friends
Working CGI FormMail
« Reply #2 on: June 11, 2003, 10:58:48 AM »
Sorry about that, i realized I wrote that whole message to your topic that had nothing to do with formmail.

Here's an example of the form
<form method=post action="cgi-bin/FormMail.pl">
//email of where the form needs to go
  <input type=text" name=recipient value="$someone@somewhere.com">
//Real name of who is sending the email
  <input type="text" name="realname" value="$Name"><br>
//email that the form is from
  <input type="hidden" name="email" value="you@yourdomain.com"><br>
//Subject of email
<input type="text" name="subject" value="$subject"/><br>
//where you want the url to go after the form is submitted (a success page)
<input type="hidden" name="redirect" value="http://domain.com/success.html"><br>
//values filled out in the form the email will show the name of these
<input type="text" name="Body" value="$user input">
</form>