如果我通过 API 调用添加电子邮件,如何摆脱以太网 Outlook 中的尖括号?

发布于 2025-01-18 10:01:54 字数 1159 浏览 4 评论 0原文

我有问题。将我的加载项添加到在线Outlook之后,自动添加了Sidebar的电子邮件。 电子邮件的名字有额外的命名。 例如: 电子邮件:

> <

我在加载项中使用office.app.js,以防万一

function _getMailItem() {
            return Office.context.mailbox.item;
 }

function addRecipientPortion(listName, emails) {
            var deferred = $q.defer();
            var mailItem = _getMailItem();
            var recipientList = mailItem[listName];

            recipientList.addAsync(emails.slice(0, 100), function (asyncResult) {
                if (asyncResult.error) {
                    deferred.reject(asyncResult.error);
                } else {
                    deferred.resolve();
                }
            })

            return deferred.promise;
        }

电子邮件acording文档必须是字符串的数组,但是如果它们是ablover,则会增加错误。

中,它不起作用。

如果电子邮件采用这种格式,它可以正常工作,但在桌面Outlook

I have question. After adding my add-in to online outlook what auto adds emails from sidebar.
Emails have extra naming in their names.
For example:
email: [email protected]
in cc field will be - [email protected]<[email protected]>

Question is why outlook added this extra <[email protected]> stuff to email?
How to remove them if I am adding them by api calls?

emails with extra less than symbol

I am using office.app.js in my add-in just in case

function _getMailItem() {
            return Office.context.mailbox.item;
 }

function addRecipientPortion(listName, emails) {
            var deferred = $q.defer();
            var mailItem = _getMailItem();
            var recipientList = mailItem[listName];

            recipientList.addAsync(emails.slice(0, 100), function (asyncResult) {
                if (asyncResult.error) {
                    deferred.reject(asyncResult.error);
                } else {
                    deferred.resolve();
                }
            })

            return deferred.promise;
        }

emails acording documentation must be array of string but if they are it rises error.

if emails are in this format it works fine but it did not work in desktop outlook

email format what works aka array of objects

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

つ可否回来 2025-01-25 10:01:54

长话短说,你不能。错误是在桌面Outlook中需要将额外的PRM(displayName)添加到包含电子邮件的对象(在此之前仅包含emailAddress prm)。

请注意!
如果emailAddressdisplayName具有相同的值,则在在线Outlook中,电子邮件将在三角形括号中。像这样 - “/cdn-cgi/l/电子邮件保护” class =“ __ cf_email__” data-cfemail =“ 630E1A23060E020A020A0F4D000C0E”> [email&nbsp; protiveed] &gt;

Long story short you can not. The bug was that in Desktop outlook need to add extra prm(displayName) to the object what contain email (before that it contained only emailAddress prm).

BE AWARE!
If emailAddress and displayName have same values then in online outlook the email will be in triangle brackets. Like so - [email protected]<[email protected]>
emails in online outlook with triangle brackets

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文