当我尝试用swiftmailer和symfony发送邮件时,我遇到了这个错误。
stream_socket_client(): SSL操作失败,代码1。OpenSSL 错误信息:error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed。
我用2020-05-20的mozilla cacert.pem文件更新了cacert.pem,但是没有任何改变,我不知道如何纠正这个问题。
你可以在下面找到我配置Switfmailer的代码。
swiftmailer:
default-mailer: mailer
mailers:
mailer:
transport: "%mailer_transport%"
host: "%mailer_host%"
username: "%mailer_user%"
password: "%mailer_password%"
encryption : "%mailer_encryption%"
port: "%mailer_port%"
auth_mode: "%mailer_auth%"
spool: { type: memory }
stream_options:
ssl:
allow_self_signed: true
verify_peer: false
verify_peer_name: false
还有一个信息,当我的代码出错时,会给我发邮件,这很好,我收到了邮件。关于信息,我使用了monologBundle。
swift:
type: swift_mailer
from_email: 'noreply@******'
to_email: '%mailer_alert_prod%'
# or list of recipients
# to_email: ['[email protected]', '[email protected]', ...]
subject: 'An Error Occurred! %%message%%'
level: critical
formatter: monolog.formatter.html
content_type: text/html
mailer : mailer
这真的很奇怪。
谢谢你
好吧,我发现了一些东西,我在config.yml中添加的选项在swiftmailer模块的初始化时没有被加载,我直接在swiftmailer的代码中添加了它,然后就可以了。我会在swiftmailer上开一个问题。謝謝你的幫助