Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

pgp php sendmail problem

Options
  • 22-01-2007 4:51pm
    #1
    Registered Users Posts: 648 ✭✭✭


    Hi


    i'm trying to set up a script so as the info submitted in a form is encrypted with pgp and sent to the admin.

    However it will not work fOr somereason.

    ive tryed teh net and cant find any tutorial how to do this.

    does anyone know where i can get info?

    tNX






    [PHP]


    $username = "buyaustr";
    $pgp="/usr/bin/gpg";
    $user = "buyaustr";


    $carddata = 'qsdqs qsdsqdqs sq sqsqsq';
    $subject = "Wine Payment";


    $recp = 'wsaorders@mydomain.com';


    $command = 'echo "'.$carddata.'" | '.$pgp.' -a --always-trust --batch --no-secmem-warning -e -u "'.$user.'" -r "'.$recp.'"';

    echo $command;

    $encrypted='';
    putenv("GNUPGHOME=/home/buyaustr/.gnupg");
    $result = exec($command, $encrypted, $errorcode);

    echo $errorcode;


    $message = implode("\n", $encrypted);
    if(ereg("
    BEGIN PGP PUBLIC KEY BLOCK
    .*
    END PGP PUBLIC KEY BLOCK
    ",$message))
    {
    echo "It Worked";
    }else
    {
    echo "It failed";
    }

    mosMail( $email, $name , 'wsaorders@mydomain.com', $subject, $message ,0);



    [/PHP]


Comments

  • Registered Users Posts: 683 ✭✭✭Gosh


    This might help ...


  • Closed Accounts Posts: 382 ✭✭misterq


    Are you 100% sure the server has pgp installed and you have the right paths and settings?

    Any time I have had issue it has been this kind of thing rather than the script itself.


Advertisement