Graph Java SDK: I want to send the saved draft mail but dont want it to be saved in sent items

Shahid 6 Reputation points


I am using graph Java SDK and want to send the saved draft mail but don't want it to be saved in sent items folder.Basically the control by some flag where i can opt to save or not to save in sent folder.

below code snippet which is automatically saving it in sent folder.

//send message to draft

Message draftMessage= graphClient.users(fromAddress)

//send email from above draft message.


Could you please help on it.

Thanks ,

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,396 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,711 Reputation points Microsoft Vendor

    Hello @Shahid ,

    message resource type, doesn't support "saveToSentItems": "false". Hence it is not possible to /send Draft message without saving to sentItems.
    user-sendmail along with message resource type with additional support for "saveToSentItems": "false".

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments