Send email in zend framework with embeded image in css
I want to send a HTML email using ZEND_MAIL. The problem is that I have t开发者_如何学运维o use such a css style in this email like:
background:url('middle.png') repeat-y scroll center top transparent
So I have to embed somehow the image which has to be repeated on y ax.
So my question is whether can somebody help me with and example of doing this in Zend framework.
Or if not how can I deal with this problem in other ways.
Thanks in advance.
This answer won't give a solution to your problem, wich is attaching images to an email in ZF. But when i read "css background image", i couldn't resist to say a few words about html email design.
Html Email design has not much to do with web design, there are no rules, no standards. When you design an email, you have to forget all your web standards and best practices. And i know how frustrating it is for a web developer...
Fortunately, there are guys and companies who have done and shared a lot off research on client's features support, and there is also the cool team off Html Email Boilerplate who has combined most off this scattered knowledge in a single mail template. If you look at it's source code, every design decision is commented and explained. And you should also have a look on the slides, at the bottom of their homepage.
Css background images have a really poor support, even in the major/most recent mail clients, you have to use old fashioned <img>
tag. You can check CampaignMonitor's guide to css support to have some hints on what you can use and what you can't.
Put image on your server(or somewhere online), and then point on it directly like http://www.yourdomain.com/images/nameofpic.jgp
Try in-line styles and it works fine.
精彩评论