alex-swiftify's avatar
alex-swiftify
Copper Contributor
May 05, 2025
Status:
New

Retrieve RFC message ID after sending the email

I'm using the new https://learn.microsoft.com/en-us/javascript/api/outlook/office.messagecompose?view=outlook-js-1.15&preserve-view=true#outlook-office-messagecompose-sendasync-member(1) method to send the email from the compose window of the office.js Outlook add-in.

As the documentation suggests, the callback code after calling mailItem.sendAsync() isn't guaranteed to be executed (and according to my tests, it never does).

My add-in needs to get an RFC message ID and send it to our API.

I have tried a few approaches (EWS, Graph API, mailItem.internetMessageId, etc) to retrieve the RFC message ID after calling mailItem.saveAsync() but before sending the email, but none of these methods worked.

Is it possible to retrieve an RFC message ID for a mail item for which I'm calling mailItem.sendAsync()?

 

Related https://github.com/OfficeDev/office-js/issues/5528#issuecomment-2791624548.

1 Comment

  • Victor_Ivanidze's avatar
    Victor_Ivanidze
    Bronze Contributor

    Hello,

    can you retrieve this ID from the email moved to the Sent item folder after sending?