java收取notes邮件_使用Java API从Lotus Notes NSF文件中提取电子邮件消息

您可以编写一个简单的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方法.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值