gpg/php problems ....

From: Date: Tue, 08 Jun 2004 08:33:18 +0000
Subject: gpg/php problems ....
Groups: php.general 
Request: Send a blank email to php-general+get-187861@lists.php.net to get a copy of this message
the code below encrypts a phrase using gpg and sends out via email ... i get the data ok ... but my mail client does not show it ... if i "view email sorce" i can see the encrypted message ... what am i doing wrong? thanks, jd $username = "mohadib"; $pgp="/usr/bin/gpg"; $user="Zend Commerce <goat@gostse.cx>"; $recp="jd@taproot.bz"; //$data=$oneOrder; $command = 'echo "hello word" | '.$pgp.' -a --always-trust --batch --no-secmem-warning -e -u "'.$user.'" -r "'.$recp.'"'; $oldhome = getEnv("HOME"); putenv("HOME=/home/$username"); $result = exec($command, $encrypted, $errorcode); putenv("HOME=$oldhome"); $subject="Test message"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/encrypted; protocol=\"application/pgp-encrypted\"; boundary=\"=-uc4rTrDFZtVQGtcexwyv\"\r\n"; $message = "--=-uc4rTrDFZtVQGtcexwyv Content-Type: application/pgp-encrypted Content-Transfer-Encoding: 7bit Version: 1 --=-uc4rTrDFZtVQGtcexwyv Content-Type: application/octet-stream; name=encrypted.asc Content-Transfer-Encoding: 7bit\n\n"; $message .= implode("\n", $encrypted); $message .= "\n\n--=-uc4rTrDFZtVQGtcexwyv--"; mail($recp,$subject,$message,$headers);

« previous php.general (#187861) next »