带有发送电子邮件的图像附件
我正在寻找一种在 Magento 中附加带有发货确认电子邮件的图像的方法。 pdf 附件上的线程很少,但就我而言,我想在电子邮件中附加“媒体”文件夹中的图像。知道如何做到这一点吗?
I am looking for a way to attach an image with shipped confirmation email in Magento. There are few threads on pdf attachments but in my case I want to attach an image from 'media' folder with the email. Any idea how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不。附件会降低您的送达率。
只需将您的电子邮件设置为 html 并使用位于任何公开可用服务器上的文件的 img src 即可。无需附件。
Don't. Attachments drop your deliverability numbers.
Simply setup your email as html and use an img src to a file located on any publicly available server. No attachment required.
快速提问:图像每次都是相同的还是特定于客户订单的?我认为这是不同的,否则你不会问。
澄清一下:如果您发送发票/交货单/订单确认书,附件是可以的。不过,建议您设置您的电子邮件,以便可以直接验证 IP 地址。还建议您在 DNS 中使用 SPF 记录,以便远程邮件服务器可以检查您的服务器是否允许为您发送电子邮件。此外,在您的订单成功页面中,您还可以要求您的客户将您添加到他们的地址簿中,这样您的电子邮件就不会被标记为垃圾邮件,无论您是否有 SPF 记录和设置。唯一的是你不能保证客户会这样做,所以SPF记录和IP反向查找是最好的。您还可以将 DomainKeys DKIM 用于雅虎邮件等 - 邮件传递不是这个问题的重点,因此您必须自己 Google DKIM...
否则,附加图像很简单。请参阅《Zend 程序员参考指南》页面顶部有关附件的示例:
http://framework.zend.com/manual/en/zend.mail.attachments.html
继续阅读评论,了解如何获取包含的图像数据。
希望有帮助!
Quick question: is the image the same every time or specific to a customer order? I presume it is different or you wouldn't be asking.
To clarify: attachments are okay if you sending out invoices/delivery notes/order confirmation. However you are advised to setup your email so that the IP address can be verified directly. You are also advised to use a SPFrecord in your DNS so that the remote mail server can check that your server is allowed to send emails for you. Furthermore, in your order success page you can also ask your customers to add you to their address book, in that way your emails will not be marked as SPAM, regardless of whether you have SPF records and things setup. The only thing is you cannot guarantee customers will do that, so the SPF records and the IP reverse lookup is best. You can also use DomainKeys DKIM for the likes of Yahoo mail - mail delivery isn't what this question is about so you will have to Google DKIM for yourself...
Otherwise, attaching an image is simple. See the example at the top of the page of the Zend Programmers Reference Guide on attachments:
http://framework.zend.com/manual/en/zend.mail.attachments.html
Keep reading the comments for clarification on how to get the image data included.
Hope that helps!