Rob Prime wrote:Just remove the "Mime" part from Ulf's code. You should program against the interfaces and abstract classes anyway. Sure, getContent() returns a MimeMultipart now, but in the future that may change to some other Multipart implementation.
And don't forget to check the type of getContent() - it could very well be a String for plain text emails without attachments. So:
Ulf Dittmer wrote:That's why I said "Something like..."; I didn't want to do all your work :-)
Do you know how to find out the exact class of an arbitrary Java object? And are you familiar with the concept of casting?