Domanda

I have a question about receiving emails from a smtp server. So I must get the messages from the server and get their body but I have a problem with this. I tried get the input stream of the message and read it all but it read really the all content of the message. So my question is : How to read a mail message body with Java mail api, the title part and the from part?

I search in google but with no success. I'm sorry if the question look stupid but I'm a beginer in Java Mail API.

Thanks in advance.

È stato utile?

Soluzione

try this

you can read just the message body using the getContent method.

((MimeMessage)message).getContent();

this is an exceptionally well written resource on JavaMail API

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top