开发者

Java Mail API read message body problem

开发者 https://www.devze.com 2023-04-02 11:54 出处:网络
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 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

精彩评论

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

关注公众号