Office.context.mailbox.item.body.setAsync从签名中删除原始base64 [英] Office.context.mailbox.item.body.setAsync removing original base64 from signatures

查看:362
本文介绍了Office.context.mailbox.item.body.setAsync从签名中删除原始base64的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Outlook加载项中使用Office.context.mailbox.item.body.getAsyncOffice.context.mailbox.item.body.setAsync Javascript方法将一些内容添加到邮件正文中.它运行得非常好,除非用户的签名上有图像.图像消失,仅显示其alt属性.如果我检查html,则存在<img>元素,但是src属性变为(unknown)而不是显示原始的base64.

I'm trying to use Office.context.mailbox.item.body.getAsync and Office.context.mailbox.item.body.setAsync Javascript methods in my Outlook add-in to add some content to the mail body. It's working really well, except when the user has an image on its signature. The image disappears and only its alt attribute is shown. If I inspect the html, the <img> element is there, but the src attribute turns into (unknown) instead of showing the original base64.

推荐答案

我在这个问题上工作了几天,对图像没有任何解决方案,并且我认为在使用getAsync和setAsync之后,对于体内的本地图像目前还没有解决方案.唯一适合您的图片是位于外部服务器或Outlook表情符号上的图片.

I work days on this problem without any solution to image,and I think that right now no solution for local images inside the body after using getAsync and setAsync . The only images that could work for you it's images that sit on external server or outlook emoji .

您可以阅读更多

You could read more Here , this question is on Microsoft developer forum , the conclusion from this question is:

Outlook对象模型和Outlook加载项不同.当您手动发送带有图像的电子邮件时,它将使用Outlook对象模型,并将图像存储在电子邮件项目中,"src ="cid:"表示电子邮件对象中的图像对象. 使用Office加载项发送时,电子邮件正文仅通过"src"指示图像的位置.没有在邮件项目中插入真实图像.要同时在发送者和接收者中显示图像,您需要将图像放置在每个人都可以访问的公共场所.

Outlook Object Model and Outlook Add-ins are different. When you send email with image manually, it uses Outlook Object Model, and store the image in the email item, "src="cid:" indicate that image object in the email object. When you send with Office Add-ins, the email body only indicates the location of the image by "src". There is no real image inserted into the mail item. To show the image both in sender and receiver, you will need to place the image in a public place that everyone could access.

您也许可以尝试使用 Outlook rest API .您现在可以从加载项中轻松地使用Outlook rest API.有关此功能的更多信息,请参见问题,并尝试使用Outlook Rest API请求解决图像问题,以在使用"setAsync"之前获取所有附件,然后将图像源更改为基本64图片的数据.

You can maybe try to use Outlook rest API . You could use now Outlook rest API in easy way from your add in .Read more about it in this link. Then follow on this question and try to solve the image problem with Outlook rest API request to get all attachment before using 'setAsync' and then change the image source to the base 64 data of your image.

祝你好运.

我在此处写下一些基本问题的答案: outlook加载项图像&文件,也许可以帮助您解决问题.

Edit : I write answer to fimiliar question here: outlook add-in image & files , maybe it's could help you to solve your problem .

这篇关于Office.context.mailbox.item.body.setAsync从签名中删除原始base64的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆