作者 邓超

优化

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