isSMTP(); $mail->SMTPDebug = $SMTP['debug_level']; $mail->Debugoutput = function($message, $level) { error_log("$log_prefix SMTP (level $level): $message"); }; $mail->Host = $SMTP['host']; $mail->Port = $SMTP['port']; if (isset($SMTP['user'])) { $mail->SMTPAuth = true; $mail->Username = $SMTP['user']; $mail->Password = $SMTP['pass']; } if ($MAIL['tls'] == TRUE) { $mail->SMTPSecure = "tls"; } $mail->setFrom($EMAIL['from_address'], $EMAIL['from_name']); $mail->addAddress($recipient_email, $recipient_name); $mail->Subject = $subject; $mail->Body = $body; if (!$mail->Send()) { error_log("$log_prefix SMTP: Unable to send email: " . $mail->ErrorInfo); return FALSE; } else { error_log("$log_prefix New user: sent a new account email to $recipient_email ($recipient_name)"); return TRUE; } } ?>