Hi,
This is very hard to correctly display an email in all webmail. The best solution today is put your CSS in the HTML, example :
Instead of having :
h2.title {
font-weight:bold;
color:#FF0000;
}
<h2 class="title">My title</h2>
You will have a better support declaring like that :
<h2 style="font-weight:bold; color:#FF0000;">My title</h2>
For example, Gmail only accept inline CSS. So, if you want your mail correctly appear to gmail, you have to use the second solution.
But putting an inline CSS is very time consuming. In addition, there is lot of chances that the inline CSS break your website design, so, it's ok in your webmail but this is your website that become altered.
I think a solution would be to create a jquery routine to mimemail that convert external CSS into inline CSS. I think this should be doable using jquery.
The role of the function would be to read your external CSS file (example : mail.css), and to read the HTML of your email. Then, if a tag have a class that is defined in the CSS, replace it with inline style.
What about this idea ?
zmove
Comments
Comment #1
jerdavisjquery may have the tools to handle this a bit better, however jquery being javascript is executed client-side. What we'd need to accomplish what you're talking about is something that worked server-side through PHP so that each message sent through mimemail could have it's CSS cleaned up and the proper inline tagging injected.
The easiest solution in the current incarnation of mimemail would be to override the theme_mimemail_message() function. This would at least give you control over the wrapper allowing you to control part of the layout through element styles.
Jer
Comment #2
webel commentedAm very interested in this feature suggestion.