如何使用 zend 框架发送包含内嵌图像的电子邮件?
文档指定了如何添加内联附件,但是从 html 部分引用它的正确方法是什么? 是否可以像其他库一样自动包含图像?
也许有人写了一些片段并愿意分享?
The documentation specifies how to add inline attachement, but what is the correct way of referencing it from the html part? Is it possible to include images automatically as it is in other libraries?
Maybe someone has written a little snippet and is willing to share?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这不完全是一件小事,幸运的是,有人已经将 Zend_Mail (
Demo_Zend_Mail_InlineImages
) 子类化来做到这一点,请参见此处:http://davidnussio.wordpress.com/2008/09/21/inline-images-into-html-email -with-zend-framework/
That's not exactly a trivial thing, lucky for you someone has subclassed Zend_Mail (
Demo_Zend_Mail_InlineImages
) to do that, see here:http://davidnussio.wordpress.com/2008/09/21/inline-images-into-html-email-with-zend-framework/
我为邮件类编写包装器
i write wrapper for mail class
您可以使用 html 直接将图像嵌入到 base64 中,而不是扩展 Zend_Mail。
这是我包含在电子邮件模板中的示例图像:
Instead of extending Zend_Mail you can directly embed your image in base64 using html.
Here is an example image that I included in my email template: