'webmaster@example.com', 'Subject' => 'Preface to the Poems Composed at the Orchid Pavilion (Chinese original)', 'To' => 'webmaster@example.net', 'Cc' => 'user@example.net', ); $mime = new Mail_mime(); $ret = $mime->setTXTBody($txt_file, true); if (!$ret) { print "email problem with txt\n"; } $ret = $mime->setHTMLBody($html_output, false); if (!$ret) { print "email problem with html\n"; } $options['head_encoding'] = 'quoted-printable'; $options['text_encoding'] = 'base64'; $options['html_encoding'] = 'base64'; $options['html_charset'] = 'utf-8'; $options['text_charset'] = 'gb2312'; $options['head_charset'] = 'utf-8'; $body = $mime->get($options); $headers = $mime->headers($extra_headers); $mailer = Mail::factory('sendmail'); $to = array('webmaster@example.net', 'user@example.net'); $mailer->send($to, $headers, $body); ?>