/[corp_html]/inc/quoted-printable.inc
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /inc/quoted-printable.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Mon Mar 5 11:56:09 2001 UTC revision 1.2 by dpavlin, Wed Nov 21 10:21:57 2001 UTC
# Line 70  Content-Transfer-Encoding: quoted-printa Line 70  Content-Transfer-Encoding: quoted-printa
70          return 1;          return 1;
71  }  }
72    
73    /* don't add newlines to output stream */
74    function e_qp_nonl($foo) {
75    
76            $out="";
77            
78            for($i=0; $i<strlen($foo); $i++) {
79                    $c=substr($foo,$i,1);
80                    $p=ord($c);
81                    if ($p == 10) {
82                            $out.="\n";
83                    } else if (($p >= 33 && $p <= 60) ||
84                            ($p >= 62 && $p <= 126)) {
85                            $out.=$c;
86                    } else {
87                            $out.=sprintf("=%02X", $p);
88                    }
89                    
90            }
91            return $out;
92    }
93    
94    /* like sendmail -t ... extract headers from message */
95    function iso_sendmail_t($msg) {
96            $mail=popen("/usr/sbin/sendmail -t","w");
97            if (! $mail) {
98                    return 0;       // error!
99            }
100            list($h,$b)=split("\n\n",$msg,2);
101            fputs($mail, $h.'
102    X-Mailer: php-quotedprintable-mailer
103    Content-Type: text/plain; charset="iso-8859-2"
104    Content-Transfer-Encoding: quoted-printable
105    
106    '.e_qp_nonl($b));
107            pclose($mail);
108            return 1;
109    }
110    
111  ?>  ?>

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26