CopyCode The Code is as follows: --- sendmail. Inc. Original. php
++ Sendmail. Inc. Mime. php
@-33,23 + 33,23 @@
$ Email_subject = '=? '. $ Charset .'? B? '. Base64_encode (str_replace ("\ r", '', str_replace (" \ n ",'','['. $ bbname. ']'. $ email_subject ))). '? = ';
$ Email_message = chunk_split (base64_encode (str_replace ("\ r \ n. "," \ r \ n .. ", str_replace (" \ n "," \ r \ n ", str_replace (" \ r "," \ n ", str_replace (" \ r \ n ", "\ n", str_replace ("\ n \ r", "\ r", $ email_message )))))));
$ Email_from = ''? '=? '. $ Charset .'? B? '. Base64_encode ($ bbname )."? = <$ Adminemail> ": (preg_match ('/^ (. + ?) \ <(. + ?) \> $/', $ Email_from, $ from )? '=? '. $ Charset .'? B? '. Base64_encode ($ from [1]). "? = <$ From [2]> ": $ email_from );
Foreach (explode (',', $ email_to) as $ touser ){
$ Tousers [] = preg_match ('/^ (. + ?) \ <(. + ?) \> $/', $ Touser, $ )? ($ Mailusername? '=? '. $ Charset .'? B? '. Base64_encode ($ to [1]). "? = <$ To [2]> ": $ to [2]): $ touser;
}
$ Email_to = implode (',', $ tousers );
-$ Headers = "from: $ email_from {$ maildelimiter} X-Priority: 3 {$ maildelimiter} X-mailer: discuz! $ Version {$ maildelimiter} mime-version: 1.0 {$ maildelimiter} Content-Type: text/plain; charset = $ charset {$ maildelimiter} content-transfer-encoding: base64 {$ maildelimiter }";
+ $ Headers = "from: $ email_from {$ maildelimiter} X-Priority: 3 {$ maildelimiter} X-mailer: discuz! $ Version {$ maildelimiter} mime-version: 1.0 {$ maildelimiter} Content-Type: ". (true === is_string ($ sendmail_mime )? $ Sendmail_mime: 'text/plain '). "; charset = $ charset {$ maildelimiter} content-transfer-encoding: base64 {$ maildelimiter }";
$ Mail ['Port'] = $ Mail ['Port']? $ Mail ['Port']: 25;
If ($ Mail ['mailsend'] = 1 & function_exists ('mail ')){
@ Mail ($ email_to, $ email_subject, $ email_message, $ headers );
} Elseif ($ Mail ['mailsend'] = 2 ){
If (! $ Fp = fsockopen ($ Mail ['server'], $ Mail ['Port'], $ errno, $ errstr, 30 )){
$ Errorlog ('smtp ', "($ Mail [server]: $ Mail [port]) connect-unable to connect to the SMTP server", 0 );
Then, you can set the global variable $ sendmail_mime to send an HTML-format email.