开发者

Java Mail API read message body problem

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开发者_如何学Go.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜