【问题标题】:Attempted to load class "Swift_Attachment" with Swiftmailer尝试使用 Swiftmailer 加载类“Swift_Attachment”
【发布时间】:2020-01-16 09:53:07
【问题描述】:

我正在使用 swiftmailer。一切正常。但是如果我添加这样的附件:

->attach(Swift_Attachment::fromPath('/images/products/' . $attachName))

我有一个错误:尝试加载类“Swift_Attachment”

有什么想法吗?

【问题讨论】:

  • 你确定为这个类设置了USE语句并清除了缓存吗?

标签: symfony swiftmailer


【解决方案1】:

Conditional attachment of file using swiftmailer and symfony2 可能重复

似乎是命名空间问题,请检查您如何调用 Swift_Message 并尝试->attach(\Swift_Attachment::fromPath('/images/products/' . $attachName))

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多