Forum Moderators: coopster
These email messages have attachments. I need to save these attachments as a file, and also keep the contents of the file as a string so they can be processed further (that's the next challenge after this one)
I can see these attachments nestled comfortably in the body of the email:
--_1f366895-b327-4f84-8985-e3826cdf604b_
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="namechangedtoprotecttheinnocent.zip"
UEsFBBQACAAIAJuy1DgAAAAAAAAAAAAAAAAKAAAAcmVwb3J0LnhtbNVdW5fbNpJ+n1/B9Z6zb8Mh
rgTPJplGt9N2HNvxiTPjM/vGltjdinUbUrLT+fVLUqJEUKSAYoE0p+10YkIdfwCBQl2+qvru73+s
lt6XJM0Dm/X3z4gfPPOyXbyex8vNOvn+2VOSPfv7D3/5y3dpst2kux++28V3y+SH72ab5X61zqr/
8NbxKv/0PN4Dz3747m+Hh43BWbzaxouHdecH4vlDutlvO8c/J09fN+m8e/zryyTb/SNddn5isdpm
Does anyone know any good pre-rolled classes that will aid in doing this effectively?
The idea of parsing and slicing up these emails manually is a little frightening, because I know it means more hours of frustration on a project which was supposed to be quick + dirty
I'm taking a step back, and using those to retrieve mail instead of what I was using before... it's working great! I can grab attachments, save them as files, then immediately read those files back into a string. I know it involves 2 I/O (write, then read) instead of 1 (just write), but it's fast enough for me.