snipsco / Postal

A Swift framework for working with emails
MIT License
652 stars 81 forks source link

Question: fetching data from body.mailParts #24

Closed loicwolff closed 8 years ago

loicwolff commented 8 years ago

Is there a way to check if an email body contains text/html and fallback to fetching plain/text?

jeremiegirault commented 8 years ago

@loicwolff Yes: You have to fetch a first time the bodyStructure only (not the body contents). You can then iterate on mailParts in order to find the text/plain inline attachment part and you can then fetch this attachment using the partId. @klefevre can you help with the method names ?