+ function encode($txt)
+ {
+
+ $opts = array('input-charset' => $_SESSION['language']->encoding,
+ 'output-charest' => 'utf-8', // utf-8 works always nowadays
+ 'line-length'=> 72,
+ 'linebreak-chars'=>'\n',
+ 'scheme' => 'Q',
+ );
+ return substr(iconv_mime_encode(null, $txt, $opts), 2);
+ }
+
+ //
+ // For backward compatibility in extensions address can be passed
+ // in $name in form: '"full name" <adr@host>'.
+ // Don't use this form unless all the mail addresses are encoded in ASCII
+ //
+ function to($name, $mail='')