Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29755

Is there any way to print the trash folder size and access that in mailbox using Java Mail API?

$
0
0

I tried to access the all folders in mailbox, but I don't know the solution.

I can access inbox perfectly, but when I try the same with other folders I'm getting a "folder not found exception". Is there a solution for this problem?

Properties props = new Properties();
props.put("mail.imap.host", "abc.tech");
Session emailSession = Session.getDefaultInstance(props);

Store emailStore = emailSession.getStore("imap");
emailStore.connect("email", "password");

Folder emailFolder = emailStore.getFolder("Trash");
emailFolder.open(Folder.READ_WRITE);

Is there any way to print the trash folder size and access that in mailbox using Java Mail API?


Viewing all articles
Browse latest Browse all 29755

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>