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
2009-07-18 04:52:18