我有一个带有RichText控件的XPage,我需要抓取它的内容并通过电子邮件发送。
我使用getComponent("rtfQuestion").getValue();
工作了
并将其附加到我的HTML电子邮件中:
var body = memo.createMIMEEntity();
var stream = session.createStream();
var url = context.getUrl();
url.removeAllParameters();
msg = "The response linked below has been submitted.<br/><br/>"
var info = "Please click <a href='" + url.toString()+ "?documentId=" + doc.getDocument().getUniversalID() + "&action=openDocument";
info = info + "'>here</a> to view the new response." + "<br/><br/><fieldset><legend>Answered by " + @Name("[CN]",doc.getItemValueString("Originator")) + "</legend>" + getComponent("rtfQuestion").getValue() + "</fieldset>";
// Set content of Body field as MIME type
stream.writeText(info);
body.setContentFromText(stream, "text/html; charset=iso-8859-1", 0);
memo.send();
我遇到的问题是当用户使用工具栏中的“插入图像”操作添加图像时,MIME内容类型为“内容类型:多部分/相关”,而图像尚未发送。
获取RichText内容并通过电子邮件发送它的最佳方法是什么?
提前致谢。
更新
这是我从getComponent("rtfQuestion").getValue()
得到的:
这是收到的电子邮件中的正文内容:
Field Name: Body
Data Type: MIME Part
Data Length: 977 bytes
Seq Num: 1
Dup Item ID: 0
Field Flags: SIGN SEAL
"MIME-Version: 1.0
Content-Type: text/html; charset=iso-8859-1
Please click <a href='http://tristan.corp.teradyne.com/applications/ask-b30.nsf/xResponse.xsp?documentId=056C62166F3A8B3E85257D490070264C&action=openDocument'>here</a> to view the new response.<br/><br/><fieldset><legend>Answered by Notes Dev1</legend><p dir="ltr">
Lorem ipsum dolor sit amet, quot mollis utamur ius ad, rebum timeam oporteat sea ea. Mea alii iriure at, ne tale probatus usu. Sonet consulatu dignissim ad per. Ne munere doming vim, ad sale everti voluptaria has.</p>
<p dir="ltr">
Labore ceteros facilisi est in. His et regione phaedrum. Eam apeirian phaedrum vituperatoribus in, ei sea sint latine nominavi, est in rebum iisque nostrum. Utinam impedit ea sit, his cu agam probatus deserun</p>
<p dir="ltr">
<img alt="" src="/applications/ask-b30.nsf/xsp/.ibmmodres/persistence/DominoDoc-18E2-Content/1.PNG" style="width: 249px; height: 172px;"></img></p></fieldset>"
答案 0 :(得分:3)
使用Tony McGuckin的emailBean代替: http://openntf.org/s/emailbean-send-dominodocument-html-emails-cw-embedded-images-attachments-custom-headerfooter