我尝试发送邮件时收到以下错误
SMTP -> FROM SERVER:220 mx.google.com ESMTP ej10sm2084527pdb.35 - gsmtp
CLIENT -> SMTP: EHLO localhost
SMTP -> FROM SERVER:250-mx.google.com at your service, [182.64.29.228]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
CLIENT -> SMTP: AUTH LOGIN
SMTP -> FROM SERVER:530 5.7.0 Must issue a STARTTLS command first. ej10sm2084527pdb.35 - gsmtp
SMTP -> ERROR: AUTH command failed: 530 5.7.0 Must issue a STARTTLS command first. ej10sm2084527pdb.35 - gsmtp
CLIENT -> SMTP: QUIT
SMTP -> FROM SERVER:221 2.0.0 closing connection ej10sm2084527pdb.35 - gsmtp
SMTP connect() failed.
SMTP connect() failed.
答案 0 :(得分:0)
在不知道您的代码的情况下,我最好的猜测是,将其添加到您的代码中:
$mail->SMTPSecure = 'tls'
注意:请将此代码改编为您的代码。