If $CFG->smtphosts is empty, then mailer uses PHP mail() == sendmail.

This commit is contained in:
martin
2002-06-06 15:21:30 +00:00
parent 5710022c65
commit 7f86ce17ba
+6 -2
View File
@@ -909,8 +909,12 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a
$mail->Version = "Moodle"; // mailer version
$mail->PluginDir = "$CFG->libdir/phpmailer/"; // plugin directory (eg smtp plugin)
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "$CFG->smtphosts"; // specify main and backup servers
if ($CFG->smtphosts) {
$mail->IsSMTP(); // use SMTP directly
$mail->Host = "$CFG->smtphosts"; // specify main and backup servers
} else {
$mail->IsMail(); // use PHP mail() = sendmail
}
$mail->From = "$from->email";
$mail->FromName = "$from->firstname $from->lastname";