Click here to Skip to main content
15,909,030 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am sending email templates from my java application, but those emails are not well formatted in gmail as I am using external styles, i know that external styles wont work in gmail but I can not change my templates into inline styles because I need to apply the different styles for single html file(template) dynamically, so I am using external styles, can any one send the logic to convert css into inline on the fly in java, I found the solution for php and phython in the web but I never found for java

Thanks,
Sree
Posted
Updated 19-May-10 23:18pm
v3

1 solution

Hi Sreeglp,
I will suggest following work around.

Instead of inline stylesheet, you can also use internal style sheet.

<style type="text/css">
...
</style>
<div>
... your template
</div>


So in this case, read the CSS file and append the string before your HTML message so that it should work as internal css.

Regards,
Jitendra
 
Share this answer
 
Comments
sreeglp 20-May-10 1:30am    
Jitendra,

I tried this one also, but it is not working in gmail

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900