Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Encoding E-mail Attachments

dadams07Sep 14 2009 — edited Sep 14 2009
I'm trying to understand the low-level details of encoding an e-mail attachment. Specifically, I'm calling a Web service that will send e-mails, & the service requires that I supply the e-mail parts (including attachments) as XML elements; in other words, I can't send the e-mail myself through the standard javax.mail package. In addition, my attachment will be a file whose content & type I don't know at compile time.

I've been researching attachment encoding, and have a found a dizzying (& bewildering) assortment of packages, classes, encoding options, etc. Can anyone shed light on the simplest way to encode data into a string that is acceptable in XML? If possible, I'd like to simply call some encoding method from a standard Java package (J2EE, J2SE, Jakarta Commons, etc.), but I can't figure out which of the multitude of classes is best fit.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2009
Added on Sep 14 2009
13 comments
603 views