home *** CD-ROM | disk | FTP | other *** search
/ Internet 53 / INTERNET53.iso / pc / software / windows / building / pricelist / _setup.5 / Group6 / wplmail.pl < prev   
Encoding:
Perl Script  |  1998-08-03  |  672 b   |  24 lines

  1. #!/usr/bin/perl
  2. $mailerprog = '/var/qmail/bin/qmail-inject';
  3.  
  4. read(STDIN, $stuff, $ENV{'CONTENT_LENGTH'});
  5. @pairs = split(/&/, $stuff);
  6. foreach $pair (@pairs) {
  7.  ($name, $value) = split(/=/, $pair);
  8.  $value =~ tr/+/ /;
  9.  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  10.  $Form{$name} = $value;
  11. }
  12.  
  13. print "Content-type: text/html\n\n";
  14. print "$Form{'OrderDetails'}\n";
  15.  
  16. open(MAIL,"|$mailerprog");
  17. print MAIL "Content-type: text/html\n";
  18. print MAIL "To: $Form{'recipient'}\n";
  19. print MAIL "From: $Form{'email'}\n";
  20. print MAIL "Subject: $Form{'subject'}\n\n";
  21. print MAIL "$Form{'title'}\n";
  22. print MAIL "$Form{'OrderDetails'}\n";
  23. close (MAIL);
  24.