Message body is empty in email

David Delisle
Thu Feb 28 03:14:01 2002

I am trying to encrypt form data and then email this data to myself.

 The email is sent correctly, but the body of the email message is
completely empty. Any help would be greatly appreciated. I believe that gpg
is not actually being run. I have given all permissions to gpg and changed
the ownership from root so that any web users can access the file. Following
is my code (I am using PHP as the programming language):

                //Set variables

                 //Directory containing the key ring
                 $gnupghome = "/var/www/vhosts/";
                 $gpg = "/usr/local/bin/gpg";
                 $recipient = "John Doe <>";
                 $to = "";
                 $subject = "Test";
                 $message = "This is a test";

                 //Set the environment variable for GNUPGHOME

                 $command =
"$gpg --armor -t --always-trust --batch --no-tty";
                 $command .= "--compress-algo 1 --cipher-algo cast5 ";
                 $command .= "--recipient '$recipient' ";
                 $command .= "--encrypt ";
                 $command .= "| /bin/mail -s '$subject' $to";
                 $pp = popen($command, "w");
                 fputs($pp, $message);

 Thank you,

 David Delisle