Ok,
Here is the solution. I've been through many PHP/PGP scripts that I could not get to work so I really don't remember where I got this one but believe it is based from a book written by Julie Meloni.
<?
$PublicKey="MyKey";
$sender_name="Peter Sender";
$sender_email="sender@my_email.com";
$secret_msg=" Secret message PGP test";
$time = time();
$msg = "Sender's Full Name:\t$sender_name\n";
$msg .= "Sender's E-Mail:\t$sender_email\n";
$msg .= "Secret Message\t$secret_msg\n\n";
//putenv("PGPPATH=/path/to/pgp");
putenv("PGPPATH=/usr/local/bin/pgp");
// $clear = "/path/to/data";
$clear = "/home/mydomain/www/temp/";
$clear .= "$time.data";
// echo "clear: $clear<BR>";
// $crypted = "/path/to/secure/data";
$crypted = "/home/mydomain/www/temp/";
$crypted .= "$time.asc";
//$file="$time.asc";
//echo "msg: $msg<BR>";
$fp = fopen("$clear", "w+") or die("Couldn't open $clear");
fwrite($fp, "$msg");
fclose($fp);
//echo "clear: $clear<BR>";
// this is for PGP 2.6.2, may be different for other versions
system("/usr/local/bin/pgp -at $clear $PublicKey -o $crypted >/dev/null 2>&1");
unlink("$clear");
$fd = fopen($crypted, "r") or die("Couldn't open $crypted");
$mail_cont = fread($fd, filesize($crypted));
fclose($fd);
// Make sure we have access to the encrypted file, & then copy it
chmod("/home/mydomain/www/temp/$time.asc", 0755);
copy("/home/mydomain/www/temp/$time.asc", "/home/mydomain/www/save/$time.asc");
unlink("$crypted");
$recipient = "test@mydomain.com";
$sender_email = "me@mydomain.com";
$subject = "Secret Message";
$mailheaders = "From: My Web Site <\"\">\n";
$mailheaders .= "Reply-To: $sender_email\n\n";
@mail("$recipient", "$subject", "$mail_cont", "$mailheaders");
//for testing
// echo "<BR>encrypted message:<BR>$mail_cont<BR>";
?>
Peter