#!/usr/bin/perl $pgpprog = "/usr/local/bin/pgp"; $mailprog = "/usr/sbin/sendmail"; $order_email = "orders\@domain.com"; print "Content-type: text/html\n\n"; sub send_mail { unless (-e $mailprog) { print <<"PrintTag"; <html><body> <h3>Can't find $mailprog</h3> </body></html> PrintTag exit(0); } open (MAIL, "|$mailprog -t") || die "Can't open mail program\n"; print MAIL "To: $order_email\n"; print MAIL "Reply-To: $billemail\n"; print MAIL "From: $billemail\n"; print MAIL "Subject: $email_subj\n\n"; # now open PGP $pgptmp = 'pgptmp'; $pgptmp .= getppid(); $pgptmp .= '.asc'; $ret_val = open (PGP, "|$pgpprog -fea +VERBOSE=0 \"orders@domain.c +om\" > $pgptmp"); if($ret_val < 1) { # print TEST "Cannot open $pgptmp\n"; # close(TEST); die ("Can't open $pgpprog!\n"); } print PGP <<"PrintTag"; An order has recently been placed at $site_address! Billing Information: $billname $billtitle PrintTag print PGP "Quantity: $quantity Item: $name $varname\n"; print PGP "Price Each: \$$price\n"; print PGP "Subtotal: \$"; printf PGP ("%.2f",$subtotal); close (PGP); open(PGPFILE, $pgptmp) || die "Can't open $pgptmp!"; while(<PGPFILE>) { print MAIL; } close (PGPFILE); unlink("$pgptmp"); close (MAIL); } #End of Script
In reply to Perl and PGPMail by krystal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |