JavaMail Getting Started tutorial receiving mail (4)

In the third part of the previous introduction to JavaMail, we learned how to send mail using the transport class provided by the JavaMail API. Similarly, the JavaMail API also provides some special classes to perform relevant operations on mail receiving. Before introducing these classes, let's first understand the architecture of the mail receiving API. A java.com is defined in the JavaMail API mail. Store class, which is used to execute the mail receiving task, we call the method in this class to get the information of each mail folder in the mailbox. JavaMail uses the folder object to represent the mail folder. All mail information in the mail folder can be obtained through the method of the folder object, and we know that the mail information can be represented by the message object. The message class contains various methods to operate the mail, such as the sender, subject, body content, sending time, etc. their working relationship is as follows:

You can see that the console outputs the original content of the mail, which has not been parsed, so it needs to be parsed before reading. The next introduction to JavaMail, the fifth parsing mail, will explain how to parse mail.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>