Auto Processing and Perl Scripts

All:

I have a Perl script that is initiated through an auto processing queue. The script works perfectly in generating the final PDF; but, cannot seem to run the mailx command in order to send the PDF back to the user.

The following is the code for executing the mailx command:

print "e-Mailing $PDF_FILE file to people on mailing list.\n\n";

$message = "PDF for $PUB_NAME attached.\n\n";

open(MAIL, "| /bin/mailx -s $PUB_NAME -a $PDF_FILE Herold.Moitoso\@lc.ca.gov" ) or die "mailx failed: $!\n\n";

# Email Body
print MAIL $message;

close(MAIL);

There are no error messages generated any where; the auto process queue reports successful completion, with no errors. And my logging file also does not report any errors.

If I manually run the script from the command line, everything works correctly including receiving the complete E-mail message with the completed PDF as an attachment.

I was wonder if anyone has encountered similar type of behavior between auto processing and manually running a script, and if anyone has found a solution.

Any advise would be greatly appreciated.

Herold M. Moitoso

Enterprise Applications & Reporting Section

Legislative Data Center