By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,215 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,215 IT Pros & Developers. It's quick & easy.

sending email with pgp

P: n/a
Can anyone see why this wouldn't work? I get the mail but it is always blank. The key
is installed on the server properly (so I am told). Basically the encrypting of the message
seems to be the only thing that doesn't work. I have stepped through it many times and
the message is fine until it gets encrypted then it becomes blank. I should at least be able
to echo it to the screen or get it in the mail and see it encrypted but I can't.
TIA,
Kelly

$message2 is the content of the email just text

$message2 = "Foo";

$subject = "This is my subject";
$headers2 = "";
$headers2 .= "MIME-Version: 1.0\r\n";
$headers2 .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers2 .= "From: " . $sender_name . " <" . $admin_email . ">\r\n";
$headers2 .= "To: " . $sender_name . " <" . $admin_email . ">\r\n";
$headers2 .= "Reply-To: " . $name . " <" . $email . ">\r\n";

$gpg = 'correct path to gnupg ';
$recipient = "email for pub key";

$encrypted_message = base64_encode(shell_exec("echo $message2 | $gpg -e -r $recipient"));
mail("", $subject, $encrypted_message, $headers2);

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Kelly <fo*@foo.com> wrote:
[-- text/plain, encoding quoted-printable, 34 lines --]
PLEASE don't post html.
Can anyone see why this wouldn't work? I get the mail but it is always
blank. The key is installed on the server properly (so I am told).
Basically the encrypting of the message seems to be the only thing
that doesn't work. I have stepped through it many times and the
message is fine until it gets encrypted then it becomes blank. I
should at least be able to echo it to the screen or get it in the mail
and see it encrypted but I can't.
Code is good, encryption returns blank... guess where the problem is :)
$encrypted_message = base64_encode(shell_exec("echo $message2 | $gpg
-e -r $recipient"));


If I use gpg this way with a random key... gpg will complain about:
"It is NOT certain that the key belongs to the person named
in the user ID. If you *really* know what you are doing,
you may answer the next question with yes

Use this key anyway?"

So is the key you are signing trusted?

If you don't care about the trust model: --always-trust

--

Daniel Tryba

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.