阅读背景:

PHP加密openssl_pkcs7_encrypt()失败

来源:互联网 

I have this code:

我有这个代码:

 $fp = fopen($unenc_path, "w");
 fwrite($fp, $msg);
 fclose($fp);

 $easy_access_emails = 'person@##.com';
 $headers =   "From: support@##.com <support@##.com>\n" . 
              "Reply-to: support@##.com\n" . 
              "Subject: " . $subject . "\n";

 $key = implode("", file("../newcert.pem"));

 $ArrayMessageProperties = explode("\n", $headers);

 $unenc_path = '..\tmp\'. preg_replace('/[^0-9]/','', microtime()) . rand(0,1000) . "msg.txt";
 $enc_path = '..\tmp\'. preg_replace('/[^0-9]/','', microtime()) . rand(0,1000) . "enc.txt";

 if (openssl_pkcs7_encrypt($unenc_path, $enc_path, $key, $ArrayMessageProperties))
 {
    $info = file_get_contents($enc_path);

    foreach ($easy_access_emails as $email)
    {
         mail($email, $subject, $info, $headers);
    }
} else {
    die("Failed Encryption");
}
 $fp = fopen($une



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: