嗨,伙计们,我正在努力通过 java 发送一封莲花笔记中的电子邮件。我可以发送电子邮件。对于外部附件,我正在构建一个富文本项目。但我不知道如何处理内联附件,例如内部图像邮件正文部分。这是我正在使用的代码。谢谢
Document doc = null;
RichTextItem rti = null;
try{
doc = db.createDocument();
doc.replaceItemValue(ServiceConstants.FROM,getFrom() );
doc.replaceItemValue(ServiceConstants.FORM, getForm());
doc.replaceItemValue(ServiceConstants.SUBJECT, getSubject());
doc.replaceItemValue(ServiceConstants.SENDTO,asVector(getSendTo()));
doc.replaceItemValue(ServiceConstants.COPYTO,asVector(getCopyTo()));
doc.replaceItemValue("Principal",getFrom());
rti = doc.createRichTextItem(ServiceConstants.BODY);
rti.appendText(getBody());
if ((getAttachment() != null) && (getAttachment().length > 0)) {
for (int i=0; i<getAttachment().length; i++) {
getAttachment()[i].save(rti);
}
}
doc.save();
if (send) {
doc.send();
}