dmsparts has asked for the wisdom of the Perl Monks concerning the following question:
sub email{ $smsreply = 'd:\inetpub\wwwroot\cgi-bin\classads\test'; { local ($buffer, @pairs, $pair, $name, $value, %FORM)}; # Read in text $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/; if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CON +TENT_LENGTH'}); } else { $buffer = $ENV{'QUERY_STRING'}; } # Split information into name/value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value = +~ tr/+/ /; $postFields{ "$name" } = $value; #populatePostFields; $from = $postFields{ "name" }; $msg = $postFields{ "DESC" }; $email = $postFields{ "email" }; $telno = $postFields{ "tel" }; $telnob = $postFields{ "telb" }; $telno = $postFields{ "tel" }; $cc = $postFields{ "CC" }; $vyear = $postFields{ "VYEAR" }; $gears = $postFields{ "gears" }; $make = $postFields{ "make" }; $model = $postFields{ "model" }; $doorno = $postFields{ "doors" }; $fuel = $postFields{ "fuel" }; if ($gears =~ auto){$gears = Automatic} else {$gears = "$gears Speed M +anual"}; $msg =~ s/%../ /g; } open EMAILREQNO, "$emailreqno" ; ($emailref)= <EMAILREQNO>; chomp($emailref); close EMAILREQNO ; $nextemailno = ($emailref+1); $extn = ".dat"; $emailfile = "E$emailref$extn"; $emailtime = "$dayname $monnm $Day $Hour$sep2$Minute$sep2$Second $year +x"; open (EMAIL, ">$emailreqpath/$emailfile"); print EMAIL "EMAIL REQUEST \n"; print EMAIL "$from \n"; print EMAIL "\n"; print EMAIL "$email \n"; print EMAIL "$telno \n"; print EMAIL "$telno \n"; print EMAIL "$vyear $make $model $doorno Door $cc CC $fuel $gears $msg + \n"; print EMAIL "\n"; print EMAIL "\n"; print EMAIL "\n"; print EMAIL "\n"; print EMAIL "\n"; print EMAIL "\n"; print EMAIL "WWW \n"; print EMAIL "$emailtime\n"; print EMAIL "EMAIL Request \n"; print EMAIL "Email Requests \n"; print EMAIL "WWW \n"; print EMAIL "\n"; print EMAIL "EMAIL \n"; close EMAIL; &oops('cannot change email ref number') unless (open(EMAILB, ">$emailr +eqno")); print EMAILB "$nextemailno"; close EMAILB; open REQORDER, "$reqordernum" ; ($reqorder)= <REQORDER>; chomp($reqorder); close REQORDER ; $nextreqorderno = ($reqorder+1); &oops('cannot create Request book entry') unless (open(NEWITEMA, ">$re +qorderpath/$reqorder")); print NEWITEMA "E$emailref\n"; close NEWITEMA; &oops('cannot change req number order') unless (open(REQNUMORDER, ">$r +eqordernum")); print REQNUMORDER "$nextreqorderno"; close REQORDERNUM; print "Content-type: text/html\n\n"; print <<"EOF"; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:/ +/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 { font-size: 36px; color: #FF0000; } .style2 {font-size: 24px} .style3 {font-size: 36px} .style4 {color: #FF0000} --> </style> </head> <body> <table width=700><TR><TD> <div align="center"> <p class="style1">Thank you for your enquiry.</p> <p class="style2">This has been logged on our system. we will get ba +ck to you shortly.</p> <p class="style2">Your Reference number is <span class="style4">E$em +ailref</span> please make a note of this.</p> <p class="style2">You will need to quote this should you need to con +tact us about your enquiry.</p> <p class="style2">Our telephone number for all enquiries is</p> <p class="style1"> 08454084000</p> </div> </TD></TR></table> </body> </html> EOF }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Email Address in Post Replies,
by JavaFan (Canon) on Dec 16, 2008 at 12:00 UTC | |
by svenXY (Deacon) on Dec 16, 2008 at 12:14 UTC | |
|
Re: Email Address in Post Replies,
by n3toy (Hermit) on Dec 16, 2008 at 15:41 UTC | |
|
Re: Email Address in Post Replies,
by Bloodnok (Vicar) on Dec 16, 2008 at 11:59 UTC | |
|
Re: Email Address in Post Replies,
by Sagacity (Monk) on Dec 16, 2008 at 15:49 UTC | |
by chromatic (Archbishop) on Dec 16, 2008 at 23:40 UTC | |
by Sagacity (Monk) on Dec 17, 2008 at 20:10 UTC | |
by chromatic (Archbishop) on Dec 17, 2008 at 22:34 UTC |