Added SMTP authentication for email delivery

This commit is contained in:
moodler
2002-11-05 06:06:18 +00:00
parent 54e90f2d97
commit 9f58537a53
5 changed files with 28 additions and 2 deletions
+6
View File
@@ -1527,6 +1527,12 @@ function email_to_user($user, $from, $subject, $messagetext, $messagehtml="", $a
if ($CFG->smtphosts) {
$mail->IsSMTP(); // use SMTP directly
$mail->Host = "$CFG->smtphosts"; // specify main and backup servers
if ($CFG->smtpuser) { // Use SMTP authentication
$mail->SMTPAuth = true;
$mail->Username = $CFG->smtpuser;
$mail->Password = $CFG->smtppass;
}
} else {
$mail->IsMail(); // use PHP mail() = sendmail
}