Outlook365发送电子邮件

时间:2017-07-06 02:30:30

标签: c# asp.net-mvc outlook

大家好我正在尝试制作一款具有通过Outlook365发送电子邮件功能的应用,我按照此链接的说明https://msdn.microsoft.com/office/office365/api/mail-rest-operations#create-and-send-messages但未成功,

https://outlook.office.com/api/v2.0/me/sendmail - 是我的终点

集管 授权 - 承载(访问令牌) Content-Type --- application / json

要发送的消息(测试)

{
  "Message": {
    "Subject": "Meet for lunch?",
    "Body": {
      "ContentType": "Text",
      "Content": "The new cafeteria is open."
    },
    "ToRecipients": [
      {
        "EmailAddress": {
          "Address": "test@a830edad9050849NDA1.onmicrosoft.com"
        }
      }
    ],
    "Attachments": [
      {
        "@odata.type": "#Microsoft.OutlookServices.FileAttachment",
        "Name": "menu.txt",
        "ContentBytes": "bWFjIGFuZCBjaGVlc2UgdG9kYXk="
      }
    ]
  },
  "SaveToSentItems": "false"
}

回应邮递员

403 Forbidden
{
    "error": {
        "code": "ErrorAccessDenied",
        "message": "Access is denied. Check credentials and try again."
    }
}

我首先使用Postman,但是我也尝试使用MicrosoftGraph和OutlookClientService而没有任何内容。

0 个答案:

没有答案
相关问题