The moose likes Other JSE/JEE APIs and the fly likes getting attachment from eml file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "getting attachment from eml file" Watch "getting attachment from eml file" New topic
Author

getting attachment from eml file

Rodrigo Bossini
Ranch Hand

Joined: Jul 03, 2009
Posts: 99
Say I have created an EML file by using OutLook. An EML file that contains an attachment.

I have opened this file by using the MimeMessage class. This class provides me with useful methods, for getting the fiedls, from, to, recipients, content, etc.
But there's no method for getting the attachment. How do I get it?


I see wind mills
Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 18365

Do a search in Other JSE / JEE API's; I've posted a recursive piece of code to investigate the contents of an email there before. You would find at least http://www.coderanch.com/t/449220/Other-JSE-JEE-APIs/java/Getting-Multiple-Attachments-from-MIMEMessage and http://www.coderanch.com/t/454945/Other-JSE-JEE-APIs/java/Java-Mail-Message-getContent-t. The previous one is more extensive; the file is returned as an InputStream.

Oh, and moving to that forum, as that's where we discuss JavaMail problems.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
 
subject: getting attachment from eml file
 
Threads others viewed
Launch Default Mail client
email sending service
JavaMail Problem.
JavaMail:getting the extension of an attachment file
Jakarta Mailer tags attachment problem
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture