PHP 8.5.0 Alpha 4 available for testing

Voting

: nine minus five?
(Example: nine)

The Note You're Voting On

dmitri at gmx dot net
19 years ago
Working example:

<?php

$data
= <<< EOF
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

You have my authorization to spend 10,000 on dinner expenses.
The CEO
EOF;

$fp = fopen("msg.txt", "w");
fwrite($fp, $data);
fclose($fp);

$headers = array("From" => "[email protected]");

openssl_pkcs7_sign("msg.txt", "signed.txt", "file://email.pem", array("file://email.pem", "123456"), $headers);

$data = file_get_contents("signed.txt");

$parts = explode("\n\n", $data, 2);

mail("[email protected]", "Signed message.", $parts[1], $parts[0]);

echo
"Email sent";

?>

<< Back to user notes page

To Top