[Domino]Java访问Domino邮件代码片断[2]

 

[Domino]Java访问Domino邮件代码片断[2]

编写者

日期

关键词

郑昀@ultrapower

2005-6-21

Java Domino

 

回复用户收件箱中的某一封邮件

2个知识点:

1:需要通过noteID来定位该邮件:

Database dbMail = sNotes.getDatabase(sNotes.getServerName(),

                      mailfile, false);

Document doc = dbMail.getDocumentByID(noteid);

2:通过DocumentcreateReplyMessage方法创建回复邮件。

代码片段:

Database dbMail = sNotes.getDatabase(sNotes.getServerName(),

                      mailfile, false);

Document doc = dbMail.getDocumentByID(noteid);

if (doc != null)

{

                       /* createReplyMessage的参数说明

                        * boolean toall

                        If true, the new document recipient list contains all the

                        recipients of the original. If false, the new document

                        recipient list contains only the sender of the original.

                        */

                       Document reply = doc.createReplyMessage(false);

 
                       Item itemSubject = doc.getFirstItem("Subject");
                          String strItemRe = "回复:" + itemSubject.getText();
                       reply.replaceItemValue("Subject",
                               strItemRe);

                    reply.replaceItemValue("Body",

                           body);

                    reply.send(doc.getItemValueString("From"));

}

 

编写者

日期

关键词

郑昀@ultrapower

2005-6-21

Java Domino

 

posted @   老兵笔记  阅读(524)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示