From 627407365c432796b5fa0332d7a6fc429aa23051 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 28 Nov 2003 10:57:58 +0000 Subject: [PATCH] Tiny hack for Qmail - I've come across one system which REQUIRED the IsQmail method of phpmailer to be used. This is now possible just by specifying "qmail" in the smtphosts field. --- lib/moodlelib.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 0b86aa91c2d..423b554f868 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -883,7 +883,13 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a $mail->CharSet = get_string("thischarset"); } - if ($CFG->smtphosts) { + if ($CFG->smtphosts == "qmail") { + $mail->IsQmail(); // use Qmail system + + } else if (empty($CFG->smtphosts)) { + $mail->IsMail(); // use PHP mail() = sendmail + + } else { $mail->IsSMTP(); // use SMTP directly if ($CFG->debug > 7) { echo "
\n";
@@ -896,8 +902,6 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a
             $mail->Username = $CFG->smtpuser;
             $mail->Password = $CFG->smtppass;
         }
-    } else {
-        $mail->IsMail();                               // use PHP mail() = sendmail
     }
 
     $adminuser = get_admin();