Message body is empty in email

David Delisle david@webbloom.com
Sat Feb 23 19:24:02 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. Following is my code (I am
using PHP as the programming language):

               //Set variables

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

                //Set the environment variable for GNUPGHOME
                putenv("GNUPGHOME=$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);
                pclose($pp);

Thank you,

David Delisle