How to forward an email using Office JS Add-in API?

筅森魡賤 提交于 2019-12-08 08:59:22

问题


I'm trying to develop an add-in using Office 365 Javascript API for Outlook. I'm using Microsoft's reference to look for methods that will allow me to forward the currently opened email when I click a button. The issue is that there's not a single method on the reference that can do that, how can I forward an email using Office JS API?

I imagine it should be something like that:

var item = Office.context.mailbox.item;  # item represents the currently opened email
item.Forward(email)

回答1:


There isn't a method for forwarding the current email included in Office.js.

One alternative solution would be to use Microsoft Graph for this. You'll need to register an Application ID using the steps outlined in Authenticate a user with an single-sign-on token in an Outlook add-in.

Once you have a token and the message's id, you call into Microsoft Graph /forward endpoint:

POST https://graph.microsoft.com/v1.0/me/messages/{id}/forward
Content-type: application/json

{
  "comment": "",
  "toRecipients": [
    {
      "emailAddress": {
        "name": "recipient-name",
        "address": "recipient-email"
      }
    }
  ]
}



回答2:


Currently the feature you requested is not part of the product.

However, we track Outlook add-in feature requests on our user-voice page. Please add your request there.

Feature requests on user-voice are considered when we go through our planning process.

[Outlook Add-ins Engineering Team]



来源:https://stackoverflow.com/questions/48015301/how-to-forward-an-email-using-office-js-add-in-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!