Tuesday, July 8, 2014

OSB, Multipart Email and reading attachments in IPad

How to send an email with attachment in OSB is already covered elsewhere.

However there are some caveats: some email clients like IPad/IPhone are really picky, and they don't handle correctly a PDF in attachment if the OSB default is used.

Here it says: OSB when an attachment is present in the message, OSB is overrding the "Content-Type" property to "multipart/related" inspite of me setting the "Content-Type" property of HTTP Transport Header in OSB

The problem is that an IPad seems to handle correctly only messages with "Content-Type" = multipart/alternative or multipart/mixed. So the only choice is to manufacture yourself the $body message to send to the SMTP Mail Business Service, by hardcoding the multipart/alternative. By no means you should have Content-ID around: IPad doesn't like them.

This is done in an Oracle Support article : Service Bus 11g: How to Send a Multipart Email (Doc ID 1561677.1)

To import the project in a OSB version prior to 11.1.1.6, in ExportInfo, change : imp:property name="productversion" value="11.1.1.5" and rejar everything.

Refer to http://en.wikipedia.org/wiki/MIME for comprehensive explanation of MIME standards.

Gmail menu "show original" was essential to debug the actual email content.

See also this article where Apple support warns about possible issues with attachment... guys, how about testing better your code and make it more robust?

Also, always remember to delete $attachments variable before you route to BS !

One more thing: it seems that iOS changes the filename into filename="mime-attachment.pdf" for large PDF ( > 50 KB approximately). This is really really weird. no workaround so far. Not a HUGE issue, but still annoying. Actually this seems to happen only if there is a space in the filename...

No comments: