作者 邓超

优化

... ... @@ -354,12 +354,12 @@ class MailFun {
* @author:dc
* @time 2023/11/7 10:47
*/
public static function smtpLoginTest($smtp,$email,$password){
public static function smtpLoginTest($smtp,$email,$password,$debug=false){
$smtp = self::getHostPort($smtp,465);
// 邮件对象
$mail = new PHPMailer();
//Server settings
$mail->SMTPDebug = SMTP::DEBUG_OFF;//调试输出 SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->SMTPDebug = $debug ? SMTP::DEBUG_SERVER : SMTP::DEBUG_OFF;//调试输出 SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = $smtp['host']; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
... ...