How can we pass References in email header using msgraph api?

Sagufta Parween 1 Reputation point
2021-09-07T06:57:11.717+00:00

Earlier we are using the Java mail api to send an email and we are using the References attribute to set the application context.But when we are trying to use msgraph api , then we are trying to set the References , its giving error to use the custom header(internetmessageheader) instead . But the custom headers are not respected in reply or forward.

So we want to know is there anyway we can pass References in email header using msgraph api?

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

2 answers

Sort by: Most helpful
  1. Shweta Choudhary 601 Reputation points Microsoft Employee
    2021-09-08T07:09:13.22+00:00

    Thank you for reaching out.

    'Message' resource supports -

    1. Adding your own data as custom Internet message headers. Add custom headers only when creating a message, and name them starting with "x-". Once the message has been sent, you cannot modify the headers. To get the headers of a message, apply the $select query parameter in a get message operation.
    2. Adding your own data as custom properties as extensions.

    You can create a draft of the Forward/Reply message. You can then update or send the draft.

    Thanks.

    0 comments No comments

  2. Sagufta Parween 1 Reputation point
    2021-09-08T08:47:16.66+00:00

    Hi @Shweta Choudhary ,

    Thank you for your reply.

    We have tried adding custom header and they are available in the recipient mailbox but when the recipient reply / forward the custom headers are getting lost. Do we need to set any extra attributes to retain the custom header value once it got forwarded/replied?

    And also we have tried adding our own custom property using singleValueExtendedProperties and observed the extra attributes are also getting lost once the mail get from the reciepient mail box.

    Is it possible to update the Reference tag once the message is get created as draft and send it?