Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Generic Mail Form Processor

by pschoonveld (Pilgrim)
on Apr 13, 2000 at 22:55 UTC ( #7511=snippet: print w/ replies, xml ) Need Help??

Description: The following uses CGI.pm as an easy way to deal with CGI vars. Sends me email from any web form. Prints each var "paco=taco" format.

At the end it tells the browser to go to an html page.

#!/usr/bin/perl
use CGI qw(:standard);
@submits = param();

open(MAIL, "|/usr/sbin/sendmail -oi -t") or die "Can't Open Sendmail: 
+$!";
print MAIL <<EOF;
From: Web Page
To: patrick\@pacoswithtacos.com
Subject: Web Form Submission

EOF

foreach $item (@submits) {
   print MAIL "$item=".param($item)."\n";
}
close(MAIL);
print "Location: ../thank_you.html\n\n";
Comment on Generic Mail Form Processor
Download Code

Back to Snippets Section

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://7511]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2014-12-18 01:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (41 votes), past polls