Compose Outlook Email Using Mailto Inside Power Apps Form

Below are the components used in this document:
  • Power Apps
  • Microsoft Outlook

Introduction

 
Recently I got a requirement where I was asked to open Outlook with pre-populated Subject and Body on a button click from a Power Apps form. Usually sending an email can easily be achieved using Power Automate, but here we will not use it, instead we will leverage the “mailto” option. Below is the step by step way to create a new Outlook email using mailto in Power Apps form.
 

Open Power Apps and create a new Form

 
NOTE
In case you already have a Power Apps form created, you can ignore this step.
 
Step 1
 
Browse to here and provide your Office 365 account details to login
 
Step 2
 
Below page wll open and you can select either a template to start your form or you can select a blank app. (Make sure you select the right layout as well based on the target you want to build this app for). For my example I am selecting Blank app with Tablet layout highlighted with yellow color in the below image.
 
Compose Outlook Email Using Mailto Inside Power Apps Form
 
Step 3
 
Empty form will be opened.
 
Compose Outlook Email Using Mailto Inside Power Apps Form
 

Compose outlook email

 
Step 1
 
You can trigger the email on any event in Power apps as per your requirement. In my example, I will send it on click of a button with pre-populated subject and body.
 
Step 2
 
Now select the “Insert” from the ribbon à select “Button”
 
Step 3
 
“OnSelect” property of the button compose your email subject and body using mailto as mentioned below. Here I am not passing “to”, “cc” and “bcc” addresses, as I want user to enter those in Outlook.
 
Launch("mailto:" &
"&subject=Search results for site"&
"&body= Hi, This is the email body")
 
Compose Outlook Email Using Mailto Inside Power Apps Form
 
Step 4
 
Test the functionality using preview (F5), click on the button. The below email will open.
 
Compose Outlook Email Using Mailto Inside Power Apps Form
 
Step 5
 
In order to make it more professional we can provide more content and bring some content to the next line in the email body with some details coming from other controls in Power Apps. Below I am reading the site name from another label and using "%0A" for moving content to the next line.
 
"mailto:" &
"&subject=Search results for " & Label2.Text &
"&body= Hi,"& "%0A"
&"Recently search was performed for " & Label2.Text & " and below is the result found."& "%0A" & "%0A"
&" Submitted Date: " & "%0A"
&" Migration Start Date: " & "%0A"
&" Go Live Date: " & "%0A"
&" HyperCare End Date: "& "%0A"
&" Source Site Title: " & "%0A"
&" Source Site URL: " & "%0A"
&" Target Site URL: " & "%0A"
&" Primary Owner: "& "%0A"
&" Migration Status Owner: "& "%0A" & "%0A"
&"Regards"& "%0A"
&User().FullName
 
Compose Outlook Email Using Mailto Inside Power Apps Form
 
Step 6
 
Test the functionality using preview (F5), click on the button. The below email will open.
 
Compose Outlook Email Using Mailto Inside Power Apps Form
That is it. I hope you have learned something new from this article and will utilize this in your work.