Please, change my note in php help!
| From: | Maciej_Niemir at ilim dot poznan dot pl | Date: | Mon, 20 Oct 2003 11:30:35 +0000 |
| Subject: | Please, change my note in php help! | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-21586@lists.php.net to get a copy of this message | ||
In PHP help I added a note...
http://www.php.net/manual/pl/function.openssl-pkcs7-sign.php
and in that code there is my e-email....
please change this....
Best regards
Maciej Niemir
below I present an improwed code:
<?php
$data = <<<EOD
Testing 123
This is a test
Test
EOD;
//save the message to a file
$fp = fopen("msg.txt","w");
fwrite($fp,$data);
fclose($fp);
//sign the message using the sender's keys
openssl_pkcs7_sign("msg.txt", "signed.eml", "file://c:/max/cert.pem",
array("file://c:/max/priv.pem","your_password"),
array("To" => "recipient <recipients@mail.com>",
"From" => "sender <sender@mail.com>",
"Subject" => "Order Notification - Test"),PKCS7_DETACHED,
"c:\max\extra_cert.pem");
$file_arry = file("signed.eml");
$file = join ("", $file_arry);
$message = preg_replace("/\r\n|\r|\n/", "\r\n", $file);
$fp = fopen("c:\Inetpub\mailroot\Pickup\signed.eml", "wb");
flock($fp, 2);
fputs($fp, $message);
flock($fp, 3);
fclose($fp);
?>
Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s
Attachment: [application/x-pkcs7-signature] S/MIME Cryptographic Signature smime.p7s