+2  A: 

If that's what your Base64 output looks like, its wrong; it should be wrapped to 76-character lines for email. Also, it looks like something added spaces (probably due to it not being wrapped)

Also, are you setting content-transfer-encoding? I see the lines setting the content-type and the content-disposition, but without the content-transfer-encoding, you'll get the default (7bit)... which will just show the encoded MIME. Which is what's happening.

I suggest checking your raw message output (e.g., "show original" in gmail) against RFC 2045 §6 and §6.8 in particular.

If this doesn't solve your question, please edit to include the raw message.

derobert
Yup, it would be a *lot* easier to debug if the raw message data was available.
middaparka
Hi, I added a raw message to the question. Any thoughts on what's happening? It does seem like the data is encoded wrong, but I'm not sure how to encode it properly.
Andrew Johnson
Also, if it helps, the attachment seems to open OK in Thunderbird, but there is also another attachment title "1.3" attached, which seems to be blank.
Andrew Johnson
The blank Thunderbird attachment is probably due to the two --SKPSMTPMessage--Separator--Delimiter in a row, with a blank line between them. I'd offer help fixing the code, except that I know neither Objective-C nor the API...
derobert
On second thought, quick googling gives http://github.com/kailoa/iphone-smtp/commit/50cbd49f351c2f0bb3a5ad6aea7736ac82d40af2 .... what is encodeWrappedBase64ForData ?
derobert