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