Swiftmailer:无法从服务器进行身份验证


Swiftmailer: failing to authenticate from the server

我的问题

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

在我的本地主机上,使用相同的配置文件和相同的电子邮件参数,电子邮件发送得很好。然而,当我尝试发送电子邮件时,我的网站会触发错误500:

Failed to authenticate on SMTP server with username 'xxx@xxx.xxx' 
using 1 possible authenticators

所以它可以在我的本地服务器上进行身份验证,但不能在线。

在我上次更新之前,它曾经正常工作,从那时起,配置文件没有任何更改。

到目前为止我已经尝试了什么

  • 我已经尝试了我能在相关主题上找到的所有可能的配置(用"~"或自己填写信息"ssl"、"login")

  • 我也尝试过各种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.yml文件:

parameters:
    [...]
    mailer_transport: gmail
    mailer_host: ~
    mailer_user: xxx@xxx.xxx
    mailer_password: thisContainsThePassword

尝试使用此配置:

mailer_transport: smtp
mailer_host: smtp.gmail.com