Add support for not saving item in SentItems when sending Draft

Add support for not saving item in SentItems when sending Draft



 Dec 06 2021
2 Comments (2 New)

Regarding send emails with the Outlook Mail Graph API, there are two options for sending an email;


  1. /sendMail. Send it with a single request. For smaller emails.
  2. /send. Send it using a draft. Needed in order to use upload session for large attachments.


For single requests (/sendMail), it’s possible to specify not to save email in sentitems;


The same does not apply to /send when sending drafts. So, after sending the mail, I have to delete the message from sentitems myself.


Here comes the trouble, because when is it ok to do so? I fail to see how I can tell.


If I do it straight away I might get 404. If I wait a bit, I might not get 404, and everything looks great, but instead some of the mails do not get sent at all (tested to both Exchange and Gmail recipient). So it seems the API uses the message to actually send it later on, but then it’s deleted and it cannot send it.


My suggestion would be to add to the API, some optional options when calling /send. These options could basically be like for /sendMail;


POST /v1.0/me/messages/<id>/send HTTP/1.1


Accept: */*


Content-Length: 35

Content-Encoding: identity

Authorization: Bearer <token>

Prefer: IdType="ImmutableId"



  "saveToSentItems": "false"



Basically this would just delete the draft once mail has been delivered to receiving mail server, instead of move it to sentitems. Exactly like /send appears to do. Consistent and you’ll save server side work and a number of requests trying to delete the messages, when users do not want sentitems to pile up.

Copper Contributor

This is actually more than just a suggestion, because currently I cannot delete from sentitems since I do not have a state. This means the headless mailbox gets filled with sentitems, the customers do not want. Not ideal, so hoping for swift resolution.

Copper Contributor

It would be good, if this also works for /forward /reply /replyAll and the respective drafts: /createForward, /createReply /createReplyAll