gpt4 book ai didi

php - 无法在 Monolog 的 yaml 配置中为 native_mailer 设置 content_type?

转载 作者:行者123 更新时间:2023-12-05 07:32:55 33 4
gpt4 key购买 nike

我目前正在尝试使用 Monolog 通过 PHP 的 native 邮件程序将未捕获的异常以 HTML 格式通过电子邮件发送给我。我收到的电子邮件很好,但 HTML 是纯文本,内容类型似乎设置为 text/plain 而我无法将 content_type 设置为 text/html 通过 yaml 配置。

我的 monolog.yaml 看起来像这样:

monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]
system_logger:
type: native_mailer
from_email: 'Some email here'
to_email: 'my_email_address@test.com'
subject: 'Uncaught exception'
formatter: monolog.formatter.html
level: error
content_type: text/html # this is not supported?

查看 Monolog 的 NativeMailerHandler,它确实有一个 setContentType 函数,但我如何通过 yaml 配置访问它?

最佳答案

在(未成功)尝试将 native_mailercontent_type 设置为 html/text 一段时间后,我刚刚切换到 swift_mailer 代替。

关于php - 无法在 Monolog 的 yaml 配置中为 native_mailer 设置 content_type?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50943638/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com