gnupg encrypted message into body of email

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gte604j
Forum Newbie
Posts: 4
Joined: Tue Aug 06, 2002 10:58 am

gnupg encrypted message into body of email

Post by gte604j »

hi,

I have gotten gnupg installed and i have it working fine for the most part the problem i am having is that i cant attach the file as the body of a email. I have to send it as a attachment.

when i try to just fopen then fread the encrypted file into a $message variable that pass to the mail function i always get less than the whole message and it never can be opened with pgp. But if i attach the file as a binary attachment i can save the file and decrypt it with pgp.

how do i get the encrypted stuff into the body though and not as a attachment

jake
User avatar
haagen
Forum Commoner
Posts: 79
Joined: Thu Jul 11, 2002 3:57 pm
Location: Sweden, Lund

Post by haagen »

Just some tip that maybe helpful.

1. Ascii armour you encryptet message. (se gpg --help)

2. Try send it from with system commands (ugly but fast):

Code: Select all

system("cat yourfile | mail -s "subject" recipt@host");
or something.

3. Try mail with php functions.

Code: Select all

$fd = fopen("yourfile", "r");
$message = fread($fd, filesize("yourfile"));
mail($reciipt, "Subject", "$message");
Just some quick untested thoughts. I hope these will help you.
daemorhedron
Forum Commoner
Posts: 52
Joined: Tue Jul 23, 2002 11:03 am

Post by daemorhedron »

Tutorial on php used with gnupg

http://www.zend.com/zend/tut/tutorial-brogdon.php

HTH! =)
Post Reply