How is your experience with the OutSystems Community?
13
Views
2
Comments
Need to Open Outlook Compose Window with Attachments and Pre-populated Content
Question

Hi everyone,

I'm working on an OutSystems application with the following requirement:

Requirement: When a user clicks Send Quotation, the system should automatically open the Outlook compose window so that the user can review and send the email manually. The email should already contain:

  • Recipient(s)

  • Subject

  • Email body

  • Required document attachments

The user should be able to review the email before sending it.

Approaches Tried

1. MAILTO

  • Able to pre-populate recipients, subject, and body.

  • Limitation: Cannot include file attachments.

2. Microsoft Graph API

  • Able to create and send draft emails with attachments.

  • Limitation: It only creates a draft email. It does not open the Outlook compose window with the draft content for the user to review and send.

Our Requirement

We do not want to send the email automatically or simply create a draft.

We need the system to:

  1. Open the Outlook compose window.

  2. Pre-populate the recipients, subject, body, and attachments.

  3. Allow the user to review and click Send manually.

Question

Has anyone implemented this in OutSystems or using any Microsoft APIs/Office integrations?

Is there any supported approach to open the Outlook compose window with attachments already included, instead of only creating a draft?

Any suggestions or alternative solutions would be greatly appreciated.

Thank you!

2021-10-09 07-57-44
Stefan Weber
 
MVP

An alternative would be that you create a EML file for the user to download and open in local Outlook for Desktop. There are components on Forge that let you create EML files, like this one https://www.outsystems.com/forge/component-overview/23688/email-eml-generator-o11.

Personally I would create the full mail as draft using Graph API as you already did and then create a Mail preview screen within my application including a send button (which in turn will send the already existing draft). Benefit is that there is no media break between the application and another one (like outlook).

Stefan

2026-03-20 01-28-51
Saugat Biswas

Hi @PRAVEEN RAJKUMAR,

 You can try the Hybrid Graph API + Deep Link Approach

This approach combines the strengths of both methods. You use the Graph API on the server side to build the payload with attachments, then use a native Microsoft deep link on the client side to open that exact draft inside the user's Outlook compose layout.  

  1. Server Side (OutSystems Logic):  

    • Consume the Microsoft Graph API endpoint to Create a Draft Message 
      (POST /users/{id}/messages) containing your recipient, subject, body, and required document attachments.  

    • The API response returns a JSON payload containing a unique ID (id) for the newly created draft. Return this id to your client action.  

  2. Client Side (OutSystems UI):  

    • Use an OutSystems JavaScript node or a standard RedirectToURL node to launch Outlook using Microsoft's official web/desktop deep-linking syntax, passing the retrieved draft ID:  (https://outlook.office.com/mail/deeplink/compose/{Draft_ID})

This forces the browser or the localized New Outlook desktop shell to instantly pop open a live edit window displaying the populated draft—complete with your files. The user can review the content and click Send manually. 

Best,

Saugat


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.