Php Swiftmailer:无法从服务器进行身份验证 我的问题

Php Swiftmailer:无法从服务器进行身份验证 我的问题,php,symfony,email,gmail,swiftmailer,Php,Symfony,Email,Gmail,Swiftmailer,我无法将我的网站配置为发送电子邮件 在我的本地主机上,使用相同的配置文件和相同的电子邮件参数,电子邮件可以正常发送。但是,当我尝试发送电子邮件时,我的网站会触发错误500: Failed to authenticate on SMTP server with username 'xxx@xxx.xxx' using 1 possible authenticators 因此,它可以在本地服务器上进行身份验证,但不能联机 在我上次更新之前,它可以正常工作,从那时起,配置文件就没有做过任何更改 到

我无法将我的网站配置为发送电子邮件

在我的本地主机上,使用相同的配置文件和相同的电子邮件参数,电子邮件可以正常发送。但是,当我尝试发送电子邮件时,我的网站会触发错误500:

Failed to authenticate on SMTP server with username 'xxx@xxx.xxx' 
using 1 possible authenticators
因此,它可以在本地服务器上进行身份验证,但不能联机

在我上次更新之前,它可以正常工作,从那时起,配置文件就没有做过任何更改

到目前为止我都试过了
  • 我已经尝试了所有可能的配置,我可以找到相关的主题(与“~”或填写自己的信息“ssl”,“登录”)

  • 我还尝试了各种gmail地址,以查看它是否与帐户相关。一个允许访问“不太安全的应用程序”,另一个不允许访问,这不重要,因为我没有配置两步验证

  • 我已经用命令行和手动清除了缓存很多次

  • 最后,我仔细检查了我的服务器DNS设置,一切似乎都正常

老实说,我现在不知所措,不知道该怎么办

文件内容 以防万一,这里是我的
config.yml
文件:

swiftmailer:
    transport:  "%mailer_transport%"
    host:       "%mailer_host%"
    encryption: ssl
    port:       465
    username:   "%mailer_user%"
    password:   "%mailer_password%"
    auth_mode:  login
    #spool:      { type: memory }
parameters:
    [...]
    mailer_transport: gmail
    mailer_host: ~
    mailer_user: xxx@xxx.xxx
    mailer_password: thisContainsThePassword
parameters.yml
文件:

swiftmailer:
    transport:  "%mailer_transport%"
    host:       "%mailer_host%"
    encryption: ssl
    port:       465
    username:   "%mailer_user%"
    password:   "%mailer_password%"
    auth_mode:  login
    #spool:      { type: memory }
parameters:
    [...]
    mailer_transport: gmail
    mailer_host: ~
    mailer_user: xxx@xxx.xxx
    mailer_password: thisContainsThePassword

尝试此配置:

mailer_transport: smtp
mailer_host: smtp.gmail.com

从我的应用程序中通过gmail发送邮件也遇到了问题。我最终使用Sendgrid处理我的交易电子邮件,并为商业电子邮件添加Gmail MX记录。从那以后就没有问题了。我就是这么做的(在我的symfony应用程序上安装SendGrid),它给了我同样的错误,这让我觉得它与gmail根本没有关系。尝试过,会再试一次。