eu_rato Posted May 22, 2007 Share Posted May 22, 2007 Hi all, I'm new to php, that's the reason i ended up here I'm using the code below to send signed messages, the message cames good in some "system's", but in other's doesn't. Is it possible to send the certificate along with the mail message?!?! This code is right?!?!?! Or exists better code to do the same?!?! $fp = fopen("C:\msgnewsletter.txt","w"); fwrite($fp,"Content-Type: text/html;charset=\"iso-8859-1\"Content-Transfer-Encoding: quoted-printable" . $body); fclose($fp); openssl_pkcs7_sign("C:\msgnewsletter.txt", "C:\signedmsg.eml", "file://C:\lettercert.pem",array("file://C:\letterprivkey.pem","PASSWORD"),array("To" => "$to","From" => "$this->FromAddress", "Subject" => "$subject"),PKCS7_DETACHED); $file_arry = file("C:\signedmsg.eml"); $file = join ("", $file_arry); $message = preg_replace("/\r\n|\r|\n/", "\r\n", $file); $fp = fopen("c:\signedmsg.eml", "wb"); flock($fp, 2); fputs($fp, $message); flock($fp, 3); fclose($fp); rename("c:\signedmsg.eml", "C:\Inetpub\mailroot\Pickup\signedmsg.eml"); Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/52466-send-signed-e-mail-through-smtp/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.