Siva
Siva

Reputation: 101

How do I get message Id after sending mail with Microsoft Graph SendMail API

I'm trying to send emails using Microsoft graph API. But Microsoft Graph API returning only http status and not sending any response.

How do I get the Microsoft message ID after sending email using graph API.

Thanks

Upvotes: 5

Views: 3671

Answers (2)

Stephan
Stephan

Reputation: 2590

You should have a look at https://learn.microsoft.com/en-us/graph/outlook-immutable-id

It specifically has a sample for sending emails and getting the immutable Id for that item.

Upvotes: 4

user2250152
user2250152

Reputation: 20823

You can create a draft of a new message

POST /me/messages

It will return message object in the response body including message id. Be aware that message id may change if a message is moved or altered.

During sending email send the message returned in the previous call in the request body.

Upvotes: 0

Related Questions