Search code examples
htmlemailsmtphtml-emailemail-client

Gmail cleans html on email forward?


I've noticed that when you forward an html email from Gmail (not sure about other providers), the html structure changes in the process. The forwarded html loses all the ids declared inside the original html, also some other 'cleaning' happens on the html too.

Can anybody explain why this happens or if it's possible to avoid? Or is it totally dependent on the smtp provider?

I have an app that monitors emails on a specific inbox and tries to parses it, but as I said when the user forwards his email to this inbox (from gmail), the email html structure gets cleaned and my code can no longer parse the html because a lot of the ids are gone.

Due to this, I have to find a new way to parse what I require from the email, like using regular expressions on the plaintext section of the MIME message.

I've searched about this matter and I couldn't find any single piece of information.


Solution

  • Gmail strips head tag and Ids and classes on pre-processor. That means when you forward or reply, to gmail, these items never existed so are not included on reply.