Changed email.inc so that it will look for older version of PHPMailer as well as the latest 6.0.x version.

This commit is contained in:
Keith Uplinger 2018-05-02 13:36:16 -05:00
parent 7c9b4ad223
commit 4aa5acbc45
1 changed files with 9 additions and 2 deletions

View File

@ -27,8 +27,15 @@ require_once("../inc/token.inc");
//
function send_email($user, $subject, $body, $body_html=null, $email_addr=null) {
if (function_exists("make_php_mailer")) {
require_once("../inc/PHPMailer/src/PHPMailer.php");
require_once("../inc/PHPMailer/src/SMTP.php");
if(file_exists("../inc/PHPMailer/src/PHPMailer.php") && file_exists("../inc/PHPMailer/src/SMTP.php")) {
require_once("../inc/PHPMailer/src/PHPMailer.php");
require_once("../inc/PHPMailer/src/SMTP.php");
} else if (file_exists("../inc/phpmailer/class.phpmailer.php")) {
require_once("../inc/phpmailer/class.phpmailer.php");
} else {
echo "PHPMailer not installed";
return false;
}
$mail = make_php_mailer();
if($email_addr) {
$mail->AddAddress($email_addr, $user->name);