Formatting HTML emails retrieved using imap
Posted: Tue Mar 04, 2003 5:11 am
Hi
I have managed to write an application for checking POP3 and imap mailboxes, but I have a problem with HTML emails.
They include head tags which are messing up my page layout. It means that css is not inheritied by the content of the mail.
A second problem is that css within the message needs to be kept to allow text and other elements to display correctly, but at the same time some html emails sometimes have css that is applied to the body (such as backgrounds). This then gets applied to the whole page and obviously spoils the layout.
Has anyone encountered this before? I can't think of how to just remove css formatting that is applied to text/images/etc., but not the body, or to remove the whole head html but leave the necessary css.
Cheers
Fergus
I have managed to write an application for checking POP3 and imap mailboxes, but I have a problem with HTML emails.
They include head tags which are messing up my page layout. It means that css is not inheritied by the content of the mail.
A second problem is that css within the message needs to be kept to allow text and other elements to display correctly, but at the same time some html emails sometimes have css that is applied to the body (such as backgrounds). This then gets applied to the whole page and obviously spoils the layout.
Has anyone encountered this before? I can't think of how to just remove css formatting that is applied to text/images/etc., but not the body, or to remove the whole head html but leave the necessary css.
Cheers
Fergus