Hi everyone,
Over the past two weeks I’ve completed the OutSystems Dev School, which I really enjoyed. For my first project, I need to build a web application where a user can drag an email from Outlook and drop it into the OutSystems app. Once dropped, the application should capture and store the following information:
Sender
CC / BCC
Subject
Email body
Attachments
I’ve searched the forum but haven’t found any similar examples. Could anyone point me in the right direction or share best practices for implementing this?
Thanks in advance for your help!
Hi @Matthias Desmet ,
Browsers cannot directly access the raw email data when you drag an email out of the Outlook desktop app. The only alternative is to integrate directly with Microsoft 365, for example, by using the Graph API or building an Outlook Add-in. However, this requires a completely different architectural approach and I wouldn't recommend this to be your first project.
You can find more information on this topic at the following links:
Hi @Mihai Melencu,
Thanks for your quick reply and advice! The OutSystems support person who’s assisting me mentioned the same concerns, and agreed this isn’t an ideal first project, but unfortunately I don’t have a choice and need to tackle it.
I'll look into the links you shared this evening. I did some research this afternoon. So far I’ve identified three possible approaches, I believe:
Microsoft Graph API
POST the binary data to an Azure API, use the C# MsgReader library to parse the email, and return the required data as JSON.
Client-side parsing with the JavaScript MsgReader library.
I started experimenting with option 3 because calling Azure services will incur costs. However, I’m stuck on how to include the msgreader.bundle.js script in OutSystems. I expected to upload it under Assets/Resources in ODC, but I can’t find such a location. In the app properties I only see Required Scripts, but that seems intended for very small scripts.
Kind regards,
Matt
Hi,
There is a Scripts section for this. After you import the script then you will need to add it as required script in your screen/block.
You can also check this article:
Use JavaScript Code from an External Library
Thank you so much!
Going to try this out now!