Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
multipart emails with attachments don't display properly on iOS devices #590
When composing a mail with a multipart/alternative body the attachments are lumped into the same multipart/alternative part as the message body alternatives. iOS devices will display only one of the parts, typically the last attachment (i.e., only one attachment and no body displays).
The solution is that the multipart/alternative part should only contain the text_part and html_part, and that part should be added to an enclosing multipart/mixed that also holds the attachments. This can be constructed using the existing module doing something along these lines:
A message built this way will work with iOS. Can the library be altered to make this unnecessary (i.e., so using text_part and html_part automatically structure the message this way?) Thanks.
added a commit
Oct 7, 2013
Thanks Chris - that helped me understand what I needed to do to get iOS to display the emails correctly.
For others - the key is that (as Chris says in link above) is to have the attachments outside the multipart/alternative block.
I have a gist (https://gist.github.com/steve500002/bfc4b027d93c0c04f126) with my code that builds an email to send so you can see the steps I took to get this to work.