今天测试PHPMailer 发送邮箱,按照常规配置,端口正常填写,但是腾讯企业邮箱就是提示错误。
解决方法:
深坑,不要加端口,把端口注释掉!
$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.exmail.qq.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'email@xxx.com'; //SMTP username
$mail->Password = 'xxxxxxxx'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged
//$mail->Port = 0;

PHPMailer发腾讯企业邮箱去端口解决报错
博主测试PHPMailer发送邮箱,按常规配置填写端口,腾讯企业邮箱提示错误。解决办法是去掉端口,将端口注释掉。
8456

被折叠的 条评论
为什么被折叠?



