简体   繁体   中英

Microsoft Graph - Send Mail

I am trying to send an email using Microsoft Graph Send Mail but I keep getting the error below

{
  "error": {
    "code": "Request_BadRequest",
    "message": "Specified HTTP method is not allowed for the request target.",
    "innerError": {
      "date": "2020-06-19T07:06:42",
      "request-id": "xxx-xxxx-xxxx-xxxx-xxxx"
    }
  }
}

I have followed this post from Microsoft https://learn.microsoft.com/en-us/graph/api/user-sendmail?view=graph-rest-1.0&tabs=http

Does anyone know if there are additional settings that I need to configure to allow post functions?

Below is my postman request

在此处输入图像描述

在此处输入图像描述

The URL is incorrect. It should be https://graph.microsoft.com/v1.0/me/sendmail . You've put sendEmail , which is causing the problem.

The request you are sending is wrong. The correct request is https://graph.microsoft.com/v1.0/users/<SenderMailId>/sendMail

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM