Get id from specific e-mail just sent using outlook

Hi
I am wondering if aspose.email for .NET can be a solution for my application need.
I am using a library that builds an e-mail with addresses, subject, body text and attachments, then it opens outlook with the pre-filled draft, and then the end-user is able to use the outlook app to edit the e-mail and send it.

After the e-mail is sent, I need my application to fetch it in order to save it as .msg (or other format). The goal is to save it as a sent e-mail, including details such as sent date, time, etc.

I know that with Aspose.Email I can get the e-mails from a “sent items folder”, but I want that exact e-mail that was sent as explained before. Is it possible to retrieve the id of the e-mail that was sent with the outlook app, so that I know exactly what e-mail I need to fetch and save in my application?
As If when I building the draft e-mail in the application, the e-mail id was something predefined or, once the e-mail is sent, outlook would send back the id of the e-mail.

Thank you

Hello @avm8,

Welcome to the support forum!

If we understand your requirement correctly, you might consider the following approach:

  • Before sending the email, you could predefine a unique id (perhaps a custom property) for each email you generate in your application. This identifier could be stored in the email’s metadata.
  • For each retrieved email, check the predefined unique id to match the email you are interested in.
  • Once you have identified the email, save it as a .msg file.

You can also share some code examples (creating messages, fetching, etc) so that we can better understand your case.

Thank you.