I'm sending emails from Android devices using the Gmail API with an alternative text/plain version. The email is structured as follows:
multipart/mixed
multipart/alternative
text/plain
text/html
attachment
Everything works great, except for the text/plain part, which is being replaced by a sanitized version extracted from the text/html part.
If I try sending to the same address as the sender (from email X to email X), both the original text/plain and text/html versions are maintained. If I send to someone else (from email X to email Y) and the email goes through Google's servers, the text/plain version is replaced and the text/html version is sanitized.
In simpler words: if I check the content in "Sent Mail", the original plain/text version is there. It is only replaced in the email that reaches the recipient.
I don't really mind the text/html version getting sanitized, but I need to keep the original text/plain version.
Does anyone have an idea of how I can keep Gmail from doing this?