Skip to content

Commit

Permalink
If $CFG->smtphosts is empty, then mailer uses PHP mail() == sendmail.
Browse files Browse the repository at this point in the history
  • Loading branch information
martin committed Jun 6, 2002
1 parent 5710022 commit 7f86ce1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/moodlelib.php
Expand Up @@ -909,8 +909,12 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a


$mail->Version = "Moodle"; // mailer version $mail->Version = "Moodle"; // mailer version
$mail->PluginDir = "$CFG->libdir/phpmailer/"; // plugin directory (eg smtp plugin) $mail->PluginDir = "$CFG->libdir/phpmailer/"; // plugin directory (eg smtp plugin)
$mail->IsSMTP(); // set mailer to use SMTP if ($CFG->smtphosts) {
$mail->Host = "$CFG->smtphosts"; // specify main and backup servers $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->From = "$from->email";
$mail->FromName = "$from->firstname $from->lastname"; $mail->FromName = "$from->firstname $from->lastname";
Expand Down

0 comments on commit 7f86ce1

Please sign in to comment.