]> git.mjollnir.org Git - moodle.git/commitdiff
Tiny hack for Qmail - I've come across one system which REQUIRED the IsQmail
authormoodler <moodler>
Fri, 28 Nov 2003 10:57:58 +0000 (10:57 +0000)
committermoodler <moodler>
Fri, 28 Nov 2003 10:57:58 +0000 (10:57 +0000)
method of phpmailer to be used.

This is now possible just by specifying "qmail" in the smtphosts field.

lib/moodlelib.php

index 0b86aa91c2dcdde88283ff9a159ab4cb374ecee5..423b554f868838817e0c80bd379313aa0fed897c 100644 (file)
@@ -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 "<pre>\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();