Page 1 of 1

gnupg encrypted message into body of email

Posted: Tue Aug 06, 2002 10:58 am
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

Posted: Tue Aug 06, 2002 3:15 pm
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.

Posted: Tue Aug 06, 2002 11:31 pm
by daemorhedron
Tutorial on php used with gnupg

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

HTH! =)