【问题标题】:converting RIchText to Mime in java using domino designer使用 domino 设计器在 java 中将 RIchText 转换为 Mime
【发布时间】:2014-02-12 13:36:12
【问题描述】:

大家好,我正在使用 Lotus notes 中的内联附件(如邮件正文中的图像)。根据有关此问题的指导(can anyone please tell how to deal with inline images in lotus notes 我正在尝试使用将邮件正文从 Richtext 转换为 MIME。Domino 版本是 8.5 .3

m_session.setConvertMIME(false);

doc.removeItem("$KeepPrivate");

doc.convertToMIME(doc.CVT_RT_TO_HTML,0);

MIMEEntity me=doc.getMIMEEntity("body");

尝试使用代理时代码运行良好。但是当部署在服务器中时,我得到了

NotesException: Conversion To MIME Failed:
[1FD8:0047-1DDC] 12-02-2014 18:30:23   HTTP JVM: HTMLAPI Problem converting to HTML.

当我搜索所有材料时,都说这是莲花笔记的问题。谁能告诉我如何解决这个问题。或者有什么解决方法吗?请帮助

【问题讨论】:

    标签: lotus-notes lotus-domino lotus domino-designer-eclipse


    【解决方案1】:

    我在 ssjs 中有一个工作的 RichText > Mime 转换脚本,我想这可以适应 Java

    function convertBodyToMimeAndSave(documentToConvert){
    
      // Create a temporary document
      // Calling convertToMime makes a MIME output of the full
      /// document and puts it in body. If you have other
      // fields than body in the original document, that 
      // will produce undesirable added content to the body
      var tmp = database.createDocument();
    
      // Put the original richtext in it 
      var rt = targetDocument.getFirstItem("Body")
      if(!rt) return targetDocument
      rt.copyItemToDocument(tmp)
    
      // Convert the temporary document to MIME
      tmp.convertToMIME(2)
    
      // Copy all Items (that is, the Body) back to the original document
      // (copying the Body specifically seemed to make the script crash)
      tmp.copyAllItems (targetDocument, true)
    
    
      targetDocument.closeMIMEEntities(true, "Body")
      targetDocument.save()
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-30
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 2010-11-03
      • 2021-04-17
      • 1970-01-01
      • 2015-06-22
      相关资源
      最近更新 更多