We are attempting to email PDF’s as attachments. When emailing to various PC’s using various email clients, there is not a problem. However, we emailed to (5) different people with iPhones and (2) showed the attachment as a “MIME-Attachment” and were unable to open it. (3) showed as a PDF and the user was able to open the PDF just fine.
One of the users who see the attachments as a “MIME-Attachment” opened the same exact email that we sent on their PC using Internet Explorer and their Gmail account. The PDF shows fine there and they forwarded it to their self (same exact gmail account) and then opened the forwarded email on their iPhone and the PDF shows fine. So, it seems they can receive PDF’s as attachments just not if sent from Xojo using our code. Is this an iPhone issue or Xojo issue?
Did you try looking at the source of what they received to see if the encoding was any different on the ones that worked and ones that didn’t.
You will need a different client to look at the message source.
Also were the iOS versions different? Did the attachment fully download? Sometimes you get the little pie circle filling up that shows the attachment is downloading. If you don’t wait for that to finish it usually doesn’t show until you go back and try again.
We found the issue. When creating the attachment, you have to specify the MIME Type after the LoadFromFile command! This really should be in the documentation as it can lead to extremely hard to find bugs.
[code]
'This code ignores the MIME Type specified and changes it to application/base64
oAttachment.MIMEType = “application/pdf”
oAttachment.LoadFromFile(oFileList.Item(i))
It is interesting that most email clients recognized the attachment as a PDF even without the MIME Type set correctly. Also, the user who’s iPhone could not recognize the PDF attachment is using an iPhone 6 with IOS 9.1.