简体   繁体   中英

how to get inner subject from .eml file in java

I have an email file in which one mail is attached. Under this mail two attachment are there, One is text file and other is email. I want all subject part which is present in .eml file. I am working on java platform please help me to find the subject part from .eml file.

The JavaMail sample program msgshow.java shows you how, in general, to traverse the structure of a message and examine all of its parts. Point it at your sample message and you'll see what it does.

For your use case, the key is to understand that the nested message will be a part of type message/rfc822, and the getContent method on that part will return an object of type MimeMessage. Once you have that MimeMessage object, you can use the getSubject method or any other method to access that data in that nested message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM