How to set saveToSentItems as false for content type as mime for send mail graph api

Uthsa Banerjee 0 Reputation points Microsoft Employee
2024-11-25T07:16:28.43+00:00
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,434 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 43,011 Reputation points
    2024-11-25T08:40:55+00:00

    Hi @Uthsa Banerjee

    I don't think you can set the saveToSentItems property when sending mail using MIME, because MIME is a format for describing mail content and structure, not for controlling mail sending behavior.

    The saveToSentItems property should only be specified when sending mail using JSON format.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

  2. Hitesh Pachipulusu - MSFT 3,390 Reputation points Microsoft Vendor
    2024-11-25T08:48:01+00:00

    Hello Uthsa Banerjee,

    Thank you for contacting Microsoft Support!

    When using the Microsoft Graph API to send an email with MIME content, the saveToSentItems parameter cannot be directly set to false in the same way it can be with JSON content. By default, the sendMail endpoint saves the message to the Sent Items folder.

    Currently, there is no built-in support to prevent saving MIME-formatted emails to the Sent Items folder. This limitation means that if you need to avoid saving these emails, you might have to consider alternative approaches, such as using JSON format for your email content where you can setsaveToSentItems to false.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.