您可以编写一个简单的Java应用程序来获取您感兴趣的邮件数据库的句柄,然后获取该数据库中标准视图的句柄,然后迭代视图中的文档.这是一些(粗略的)示例代码:
import lotus.domino.*;
public class sample extends NotesThread
{
public static void main(String argv[])
{
sample mySample = new sample();
mySample.start();
}
public void runNotes()
{
try
{
Session s = NotesFactory.createSession();
Database db = s.getDatabase ("Server", "pathToMailDB.nsf");
View vw = db.getView ("By Person"); // this view exists in r8 mail template; may need to change for earlier versions
Document doc = vw.getFirstDocument();
while (doc != null) {
System.out.println (doc.getItemValueString("Subject"));
doc = vw.getNextDocument(doc);
}
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
getItemValueString方法获取给定的“字段”值.邮件文档上的其他重要字段包括:From,SendTo,CopyTo,BlindCopyTo,Subject,Body和DeliveredDate.请注意,Body是Notes“富文本”项,getItemValueString将返回纯文本部分. DeliveredDate是一个NotesDate项,您需要使用getItemValueDateTimeArray方法.