在阅读并测试了很多解决方案后,我仍然收到此错误。
我的参数.yml
parameters:
database_host: 127.0.0.1
database_port: null
database_name: symfony
database_user: root
database_password: null
secret: holamundo
mailer_transport: smtp
mailer_encryption: ssl
mailer_port: 465
mailer_auth_mode: login
mailer_host: smtp.gmail.com
mailer_user: [email protected] /cdn-cgi/l/email-protection
mailer_password: nottherealone
还有我的 config.yml
# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
encryption: %mailer_encryption%
auth_mode: %mailer_auth_mode%
host: %mailer_host%
port: %mailer_port%
username: %mailer_user%
password: %mailer_password%
spool: { type: memory }
并通过命令行测试 swiftmailer...
php bin/console swiftmailer:email:send
我收到此错误:
[app] Exception occurred while flushing email queue: Connection could not be established with host smtp.gmail.com [ #0] [] []
如果我 ping 'smtp.gmail.com' 我会收到回复。
我在 localhost:8000 上运行 symfony,很多人说将 mailer_host 更改为类似...
mailer_host: 127.0.0.1
但我在不同的端口上运行它,所以如果我把它
mailer_host: 127.0.0.1:8000
甚至这个
mailer_host: 127.0.0.1
mailer_port: 8000
I get:
ERROR [app] Exception occurred while flushing email queue: Expected response code 220 but got code "", with message "" [] []
Thanks !