-
Notifications
You must be signed in to change notification settings - Fork 263
Open
Labels
Description
Describe the bug
We are using Microsoft Graph to create and send emails in the following way:
- Create a draft message
var draftMessage = await graphClient.Users[userEmail].Messages.PostAsync(message); - Send the draft message
await graphClient.Users[userEmail].Messages[draftMessage.Id].Send.PostAsync(); - Get the sent message using its internetMessageId
After sending, we try to retrieve the sent message by filtering with its internetMessageId:
var filter = $"internetMessageId eq '{draftMessage.InternetMessageId}'";
var messageCollectionResponse = await graphClient.Users[userEmail].Messages.GetAsync(
requestConfiguration => requestConfiguration.QueryParameters.Filter = filter
);
The issue is
When we create the draft, we receive an initial message.Id.
After sending the message, we can look it up successfully using the internetMessageId.
However, after some time, the original messageId becomes invalid — it changes in the mailbox, and trying to retrieve the message by the old ID results in an ErrorItemNotFound error.
Expected behavior
The messageId returned when creating or sending the message should remain consistent and valid
How to reproduce
.
SDK Version
5.16.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_