1

I have a client that uses Google Mail's IMAP library to read HTML email from a Gmail inbox, then uploads said email to a database for retrieval and display on a web page. The idea is to have all company-wide emails available in a centralized location for reference by employees.

I have all the code working to grab the emails from Gmail, insert into the database, and display on the internet.

The problem I am having is that when displaying the HTML emails on the website, the HTML inherits all sorts of CSS class, et al. definitions in place on the page and ruins the formatting of the original email. For example, a simple bulleted list from the email takes on a background color and specialized font. I have experimented with wkhtmltopdf to preserve formatting fidelity, but the customer wants the raw email on the page in it's original formatting rather than a linked PDF.

Is there a way I can discard all inherited formatting and display the HTML email to the web page in it's original formatting?

1 Answer 1

0

You can display the email in an iframe.

The iframe doesn't inherit the CSS from the calling parent, so your email is displayed with a clean css sheet.

Not the answer you're looking for? Browse other questions tagged or ask your own question.