将图像作为多部分/相关 MIME 对象添加到 Outlook with Office Js Addin
Add images as multipart/related MIME object to Outlook with Office Js Addin
我正在使用addFileAttachmentAsync将图像作为附件添加到Outlook 2016中的电子邮件中。有没有办法指定附件选项?我看到有一个附件详细信息类型,我可以以某种方式使用它来指定其他选项吗?我的目标是使用多部分/相关的 MIME 对象嵌入图像。
内联图像目前在平台中没有很好的支持。我们正在努力改进这一点。同时,您可以包含从 Web 加载图像<img>
标记,也可以使用此代码。在 OWA 中,发件人将看到附件很好地出现在附件中,而在 Outlook 中,图像根本不会为发件人呈现。但在这两种情况下,收件人都会看到正确的内联图像。
Office.context.mailbox.item.addFileAttachmentAsync(
"http://smartbuildings.unh.edu/wp-content/uploads/2015/06/Winter-Tiger-Wild-Cat-Images-1024x576.jpg",
"Winter-Tiger-Wild-Cat-Images-1024x576.jpg",
{asyncContext: null},
function (asyncResult)
{
if (asyncResult.status == "failed") {
//showMessage("Action failed with error: " + asyncResult.error.message);
}
else
{
Office.context.mailbox.item.body.setSelectedDataAsync(
"<img src='cid:Winter-Tiger-Wild-Cat-Images-1024x576.jpg'>",
{ coercionType: Office.CoercionType.Html,
asyncContext: { var3: 1, var4: 2 } },
function (asyncResult) {
if (asyncResult.status ==
Office.AsyncResultStatus.Failed){
showMessage(asyncResult.error.message);
}
else {
// Successfully set data in item body.
// Do whatever appropriate for your scenario,
// using the arguments var3 and var4 as applicable.
}
});
}
});
相关文章:
- 正在添加'X'按钮,在文本字段旁边使用javascript
- 如何在映射数组中添加换行符
- 正在将数据主题添加到所有项目
- ZeroClipboard-在复制之前添加到值
- 我可以在json对象中添加一个函数吗
- 将输入字段中的文本提交到我的数据库,同时将其添加到我的列表中
- 正在SharePoint 2013母版页中添加JQuery移动文件
- 如何添加浮动和非浮动,其他
- 添加文字和评论功能更新Div
- 如果使用 lodash 将属性存在于另一个对象中,则向对象添加属性
- 动态地改变“”的URL;添加新项目”;链接使用javascript/jquery
- 在函数中添加数组元素的数值
- 如何将歌曲添加到jPlayer
- 将 Outlook 2003 默认签名添加到电子邮件
- 将图像作为多部分/相关 MIME 对象添加到 Outlook with Office Js Addin
- 使用Mailto链接,如果可能的话,我可以在Outlook邮件正文中添加当前页面吗?在 asp.net
- Javascript:打开Outlook并向新电子邮件添加附件
- 是否可以在Outlook约会中添加收件人并向与会者发送邀请?
- 使用c#添加Outlook中的字符串颜色更改
- 使用mailto URL向新的outlook电子邮件添加附件