如何使用mstor读取mbox邮件消息

时间:2011-10-05 09:12:38

标签: java email mstor

任何人都可以告诉我如何使用mstor在Windows上读取mbox邮件消息

提前致谢...

2 个答案:

答案 0 :(得分:1)

访问mstor邮箱的示例网址可能是:

mstor:c:/在Microsoft Windows机器上发送邮件

从本地商店阅读消息:

Session session = Session.getDefaultInstance(new Properties());

Store store = session.getStore(new URLName("mstor:c:/mailbox/MyStore"));
store.connect();

// read messages from Inbox..
Folder inbox = store.getDefaultFolder().getFolder("Inbox");
inbox.open(Folder.READ_ONLY);

Message[] messages = inbox.getMessages();

答案 1 :(得分:1)

//Remember to add the properties in above code.

 this.properties = new Properties();
            this.properties.setProperty("mail.store.protocol", "mstor");
            this.properties.setProperty("mstor.mbox.metadataStrategy", "none");
            this.properties.setProperty("mstor.mbox.cacheBuffers", "disabled");
            this.properties.setProperty("mstor.mbox.bufferStrategy", "mapped");
            this.properties.setProperty("mstor.metadata", "disabled");
            this.properties.setProperty("mstor.mozillaCompatibility", "enbled")