Are you aware of what Power Apps Launch Email is and how it works? Well, in this Power Apps tutorial, I will show you How to Launch Email in Power Apps in detail.
Also, we will see how to Launch Email Power Apps from a Button control with various examples.
Check out: Power Apps Modern Controls
How to Launch Email in Power Apps
By executing the Power Apps Launch function and providing a “mailto” URL, we can generate a new Outlook mail message while pre-populating the recipient, topic, and email body. In further detail, this post explains this approach.
Recently, I received a request asking me to open Outlook with a button click from a Power Apps form with a pre-populated Subject and Body. Normally, Power Automate may be used to send emails with ease, but in this case, we’ll utilize the “mailto” option instead.
Refer to the screenshot below that how it looks like:
This is the overview of Power Apps Launch Email.
Read: Scan Barcodes using Power Apps Barcode Reader [Display Product Information]
Launch Email Power Apps from a Button
Here, we will see how to launch Email Power Apps from a Button control. Refer to the below different scenarios:
Example – 1:
- The below image represents one Power Apps Button Control named Click and Launch Email. When a user will click on this button, then the new mail message will open in Outlook and pre-populate the subject and message as shown below.
- To work around this, select the Button control [Click and Launch Email] and apply the code below on its OnSelect property as:
OnSelect = Launch(
"mailto: preeti@tsinfotechnologies.com",
{
Cc: "Bijay@tsinfotechnologies.com",
Bcc: "Sushree@tsinfotechnologies.com",
Subject: "Client Meeting",
Body: "Today there is a meeting with Project Client. Please be available."
}
)
Where,
- Launch = Power Apps Launch function helps to open a website or a canvas app.
- mailto = You might want to hardcode this value since this is the person who will receive the email.
- Cc = You might want to add this secondary email address to the email.
- Bcc = You can add a third-person email address.
- Subject = Provide the subject line of the email.
- Body = Enter the detailed description of the email.
Refer to the screenshot below.
This is one way to Launch Email Power Apps from a Button.
Also, Check: How to Filter Gallery by Current User in Power Apps
Example – 2:
- In this second example, you can see there is a form (Using some Power Apps Controls) in Power Apps and a Button control (SEND).
- The user will provide the mail details and click on the SEND button. Then the message details will populate in Outlook as in the figure below.
- To achieve this, set the code below on SEND button’s OnSelect property as:
OnSelect = Launch(
"mailto:" & cmbTo.Selected.DisplayName,
{
Cc: txtCc.Text,
Bcc: txtBcc.Text,
Subject: txtSubject.Text,
Body: txtBody.Text
}
)
Where,
- cmbTo = This is a Combo box control where anyone can search and select the specific user to whom you want to send the email.
NOTE:
Instead of a Power Apps Text input control, we can use the combo box control to search Office365 users from the organization. For this, you need to add a Office365Users connector and set the code below in Combo box’s Items property:
Items = Office365Users.SearchUserV2( { searchTerm: Self.SearchText, top: 10, isSearchTermRequired: false } ).value
Then, select the Combo box control and set its DisplayFields property as:
DisplayFields = ["DisplayName"]
And also, disable the Allow multiple selections from the Combo box’s Properties pane as shown below.
- txtCc = Text input control name of Cc.
- txtBcc = Text input control name of Bcc.
- txtSubject = Text input control name of Subject.
- txtBody = Text input control name of Body.
- Save, Publish, and Preview the Canvas app. Enter the email details (To, Cc, Bcc, Subject, Body)and then click on the SEND button. It will redirect to the Outlook screen directly and populate the whole Power Apps email message information.
This is how to Launch Email in Power Apps with button control.
Also, you may like some more Power Apps tutorials:
- How to Hide Top Navigation Bar in Power Apps
- Create Multiple Tabs in Power Apps Form [Lead Management Apps Example]
- How to Add Gallery Data to a Collection in Power Apps
- How to Set Gallery First Item in Power Apps Display Form
- How to Delete Power Apps Customize Form from SharePoint List
- How to Visualize Model-Driven Data in Power BI
in this Power Apps tutorial, we discussed what is Power Apps Launch Email, How to Launch Email in Power Apps.
Also, we saw how to Launch Email Power Apps from a Button control with various examples.
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com