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
+17
View File
@@ -62,6 +62,23 @@
<? print_string("configsmtphosts") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>smtpuser:</TD>
<TD>
<INPUT NAME=smtpuser TYPE=text SIZE=10 VALUE="<?=$config->smtpuser?>">
<? formerr($err["smtpuser"]); ?>
</TD>
<TD ROWSPAN=2>
<? print_string("configsmtpuser") ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>smtppass:</TD>
<TD>
<INPUT NAME=smtppass TYPE=text SIZE=10 VALUE="<?=$config->smtppass?>">
<? formerr($err["smtppass"]); ?>
</TD>
</TR>
<TR VALIGN=TOP>
<TD ALIGN=RIGHT><P>gdversion:</TD>
<TD>
+1
View File
@@ -63,6 +63,7 @@ $string['configmaxeditingtime'] = "This specifies the amount of time people have
$string['configproxyhost'] = "If this <B>server</B> needs to use a proxy computer (eg a firewall) to access the Internet, then provide the proxy hostname and port here. Otherwise leave it blank.";
$string['configslasharguments'] = "Files (images, uploads etc) are provided via a script using 'slash arguments' (the second option here). This method allows files to be more easily cached in web browsers, proxy servers etc. Unfortunately, some PHP servers don't allow this method, so if you have trouble viewing uploaded files or images (eg user pictures), set this variable to the first option";
$string['configsmtphosts'] = "Give the full name of one or more local SMTP servers that Moodle should use to send mail (eg 'mail.a.com' or 'mail.a.com;mail.b.com'). If you leave it blank, Moodle will use the PHP default method of sending mail.";
$string['configsmtpuser'] = "If you have specified an SMTP server above, and the server requires authentication, then enter the username and password here.";
$string['configunzip'] = "Indicate the location of your unzip program (Unix only). This is needed to unpack zip archives on the server.";
$string['configvariables'] = "Configure variables";
$string['configzip'] = "Indicate the location of your zip program (Unix only). This is needed to create zip archives on the server.";
+2
View File
@@ -10,6 +10,8 @@
"locale" => "en",
"auth" => "email",
"smtphosts" => "",
"smtpuser" => "",
"smtppass" => "",
"gdversion" => 1,
"longtimenosee" => 100,
"zip" => "/usr/bin/zip",
+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
}
+2 -2
View File
@@ -5,7 +5,7 @@
// database to determine whether upgrades should
// be performed (see lib/db/*.php)
$version = 2002103000; // The current version is a date (YYYYMMDDXX)
$version = 2002110500; // The current version is a date (YYYYMMDDXX)
$release = "1.0.6 +"; // User-friendly version number
$release = "1.0.7 dev"; // User-friendly version number