I have a cgi script written in perl. It basically generates an encrypted PGP file and shucks it out to an e-mail. The e-mail comes through AOK, I get no errors, but the body (i.e. - the encrypted part) isn't coming through. (I borrowed the PGP part from pgpmail.pl, so that might help.) HEre's most of it (I clipped out extraneous, so don't worry about things like missing subs):
#!/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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.