Copy Code code 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 = $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, $to)? ($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);
You can then send an HTML-formatted e-mail message by setting the global variable $sendmail_mime.