zoukankan      html  css  js  c++  java
  • [Domino]Java访问Domino邮件代码片断[3]

     

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

    编写者

    日期

    关键词

    郑昀@ultrapower

    2005-7-1

    Java Domino

     

    转发用户收件箱中的某一封邮件

    3个知识点:

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

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

                          mailfile, false);

    Document doc = dbMail.getDocumentByID(noteid);

    2:通过DocumentcreateDocument方法创建一个新文档,然后通过DocumentcopyAllItems方法将原邮件的所有字段复制过来

    3:通过replaceItemValue方法将部分字段的数值替换。

    代码片段:

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

                          mailfile, false);

    Document doc = dbMail.getDocumentByID(noteid);

    if (doc != null)

    {

                           Document forward = dbMail.createDocument();

                           // Given a destination document, copies all of the items in

                           // the current document into the destination document.

                           // The item names are unchanged.

                           // 2个参数解释如下:

                           // replace

                           // Boolean. If True, the items in the destination

                           // document are replaced. If False (default),

                           // the items in the destination document are appended.

                           doc.copyAllItems(forward, true);

                           Item itemSubject = doc.getFirstItem("Subject");

                              String strItemRe = "转发:" + itemSubject.getText();

     

                              forward.replaceItemValue("Subject",

                                            strItemRe);

                              forward.replaceItemValue("Recipients", to);

                              forward.replaceItemValue("SendTo", to);

                              forward.setSaveMessageOnSend(true);

                              forward.send(to);

    }

    这种转发方式,会将原邮件的附件一并转发。

     

     

    编写者

    日期

    关键词

    郑昀@ultrapower

    2005-7-1

    Java Domino

     

  • 相关阅读:
    排序操作
    逻辑回归
    二叉树的建立以及相关操作,平衡二叉树
    【AMAD】cookiecutter-django -- 是一个构建Django项目的脚手架工具
    【AMAD】django-allauth
    【AMAD】django-formapi -- 一个DJANGO API框架,可使用签名request,可使用form作为API的验证工具
    【AMAD】django-cities -- 为Django项目提供国家,城市数据
    【AMAD】django-countries -- 为Django app的form提供country选项,为model提供CountryField
    【AMAD】django-social-auth -- 让django使用社交网络oauth鉴权变得极为轻松!
    每周分享第9期(2019.6.1)
  • 原文地址:https://www.cnblogs.com/zhengyun_ustc/p/184629.html
Copyright © 2011-2022 走看看