--- inc/quoted-printable.inc 2001/03/05 11:56:09 1.1 +++ inc/quoted-printable.inc 2001/11/21 10:21:57 1.2 @@ -70,4 +70,42 @@ return 1; } +/* don't add newlines to output stream */ +function e_qp_nonl($foo) { + + $out=""; + + for($i=0; $i= 33 && $p <= 60) || + ($p >= 62 && $p <= 126)) { + $out.=$c; + } else { + $out.=sprintf("=%02X", $p); + } + + } + return $out; +} + +/* like sendmail -t ... extract headers from message */ +function iso_sendmail_t($msg) { + $mail=popen("/usr/sbin/sendmail -t","w"); + if (! $mail) { + return 0; // error! + } + list($h,$b)=split("\n\n",$msg,2); + fputs($mail, $h.' +X-Mailer: php-quotedprintable-mailer +Content-Type: text/plain; charset="iso-8859-2" +Content-Transfer-Encoding: quoted-printable + +'.e_qp_nonl($b)); + pclose($mail); + return 1; +} + ?>