我正在尝试使用控制台向Swiftmailer发送一封简单的邮件。最后,控制台回应[OK] 1 emails were successfully sent.
,但我的邮箱中没有收到邮件(注意:我的mail
php函数运行完美):
php bin/console swiftmailer:email:send
从:
send@example.com
至:
recipient@example.com
学科:
你好
身体:
你好
这是我的config/packages/swiftmailer.yaml
:
swiftmailer:
url: '%env(MAILER_URL)%'
#spool: { type: 'memory' }
transport: smtp
username: username@host.com
password: mypassword
host: smtp.host.com
port: 465
encryption: ssl
auth_mode: login
spool:
type: file
path: '%kernel.cache_dir%/swiftmailer/spool'
sender_address: username@host.com
antiflood:
threshold: 99
sleep: 0
delivery_addresses: []
disable_delivery: ~
logging: '%kernel.debug%'
#stream_options:
# ssl:
# allow_self_signed: true
# verify_peer: false
# verify_peer_name: false
我的.env
档案:
###> symfony/swiftmailer-bundle ###
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=smtp://smtp.host.com:465?encryption=ssl&auth_mode=login&username=username@host.com&password=mypassword
###< symfony/swiftmailer-bundle ###
任何想法 ?感谢帮助。
发布于 2018-09-29 11:05:32
您的配置对我来说似乎很好。您是否检查过帐户中是否存在“安全警报”,导致您无法从未知位置登录?
GoogleMail将此功能称为“允许安全性较低的应用”。您应该检查收件箱或邮件帐户的提示。
https://stackoverflow.com/questions/-100002799
复制相似问题