when reading mail, how do I get the message content INCLUDING its headers.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, July 19, 2002 12:22 AM

How can I get an email message content including its headers? All the methods javax.mail.Message.getContent(), javax.mail.Message.MimeMessage.getInputStream() return only the message object without the headers. Before making InputStream with Message array object, there existed mail headers in the message object. but if I creat Message object from InputStream, there is no header information. When i try to point header, nullpointerexception occurs. Header(such as FROM, TO...) disappeared. please reply my question quickly.. i'm almost going to be fired. one more question! is it possible just to remove files from Part and leave their file names? or if i use removeBodyPart(Part) method, the whole part including file name is removed?    More>>

How can I get an email message content including its headers? All the methods javax.mail.Message.getContent(), javax.mail.Message.MimeMessage.getInputStream() return only the message object without the headers. Before making InputStream with Message array object, there existed mail headers in the message object. but if I creat Message object from InputStream, there is no header information. When i try to point header, nullpointerexception occurs.
Header(such as FROM, TO...) disappeared.
please reply my question quickly.. i'm almost going to be fired.

one more question! is it possible just to remove files from Part and leave their file names? or if i use removeBodyPart(Part) method, the whole part including file name is removed?

   <<Less

Re: when reading mail, how do I get the message content INCLUDING its headers.

Posted By:   Sita_Mulomudi  
Posted On:   Friday, July 19, 2002 01:02 PM

Answering your question on reading headers:


Try the "getAllHeaderLines()" method on MimeMessage.
That returns an enumeration of strings with all the
header info. Alternatively, try "getAllHeaders()" to
get an enumeration of Header objects with each Header
object containing a name, value pair(for the message
header info)


Hope this is helpful..
About | Sitemap | Contact