I am making a request to the User.messages endpoint. All objects returned (the emails) have a mimeType property which I'm struggling to understand.
More specifically, I want to be able to extract the body of the email depending of the mimeType since I've been able to notice that depending on the mimeType, the body will be inside the body
property in payload
, or in the parts
array. What are the different mimeTypes that can be returned, and where can I find the body of the email for each one of them?
There are many MIME types that can be returned, here are a few:
The definitive reference for all this is RFC 2046 https://www.ietf.org/rfc/rfc2046.txt (you might want to also see 2044 and 2045)
To answer your question, build a tree of the message, and look either for:
An example of a complex message:
multipart/mixed
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With