Menu

Inline CSS - Gmail Issue

2010-12-07
2013-01-03
  • Srikanth Bairi

    Srikanth Bairi - 2010-12-07

    My company uses Gmail for all its communication. There is a scheduled e-mail delivery that goes out to a distribution list that has inline HTML by a reporting software. However, Gmail ignores all the CSS formatting set inside the <style></style> tags. What I want is a way to get hold of the CSS formatting information from the <style></style> tags and apply the CSS settings for each HTML tag that has style element defined.

    There is an example that I saw on this project home page inside the ConvertStyleSheets.java. However, that logic in that java class gets all the external style definitions and puts it inside the style tags. What I want is to pull all the CSS settings from inside the style tags and apply them individually for each HTML tag that has any style defined.

    Any help would be highly appreciated.

     
  • Martin Jericho

    Martin Jericho - 2010-12-07

    Your problem would be very difficult to solve in that way. I would suggest using an alternative to gmail if their server is really the cause of the problem.

     
  • Srikanth Bairi

    Srikanth Bairi - 2010-12-14

    I have checked with the company and it looks like the customer has already invested time and money ($$$) on contracts to have the enterprise google apps running (including the gmail). So, changing the e-mail server doesn't look like a viable alternative. Looks like I have to investigate the parsing and transformation that Jericho HTML Parser is going to provide. If not, I will have to use a PHP script like emogrifier and do a Runtime.exec() call and give the input as a string (HTML page) to the PHP script and get the output.

     

Log in to post a comment.