[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:通過Document的createReplyMessage方法建立回複郵件。
程式碼片段: |
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 |