Reputation:
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
Upvotes: 1
Views: 1503
Reputation: 1026
The request you are sending is wrong. The correct request is https://graph.microsoft.com/v1.0/users/<SenderMailId>/sendMail
Upvotes: 1
Reputation: 17692
The URL is incorrect. It should be https://graph.microsoft.com/v1.0/me/sendmail. You've put sendEmail
, which is causing the problem.
Upvotes: 0