💡 Challenge: When you send an email in PowerApps with the Outlook Connector using the SendMail action, the message often looks dull and unformatted to the recipient.
👉 Solution: In this blog, I'll show you a simple way to format emails professionally - without having to write a single line of HTML code.
📢 Additionally, I explain how you can embed images directly into your email!
📌 Step-by-step guide to the perfect HTML email
1️⃣ Design emails in Outlook
📌 Open Outlook and create a new email with your desired layout:
✅ Insert tables & columns
✅ Set colors, bold & links
✅ Use placeholders for dynamic content (e.g. [Name] for the salutation)

2️⃣ Extract the HTML code of the email
Send the email to yourself.
Open the sent email in Outlook.
Right- click on the email and select "View Source" .
Your Notepad / Editor will open
Copy the entire HTML code with Ctrl + A & Ctrl + C


3️⃣ Insert HTML code into PowerApps
Add an HTML text control in PowerApps.
Copy the HTML code into the control.
Replace double apostrophes (") with single apostrophes (').
Double apostrophes must be placed at the beginning and end so that PowerApps recognizes the code as text.
4️⃣ Insert dynamic content into the HTML code
If you have defined placeholders ([Name]) in your template, you can now replace them with dynamic content from PowerApps.
📌 Syntax for replacing placeholders with PowerApps values:
"Hallo " &txtName.Value& ", anbei findest du deine Buchungsbestätigung."
💡 Explanation:
"Hello" – Fixed text beginning with apostrophes
& txtName.Value & – Dynamic value from the control
"Enclosed you will find your booking confirmation." – Fixed text ending


5️⃣ Send HTML email with PowerApps
Now comes the final step: sending the formatted email.
📌 PowerApps code for SendMailV2:
Office365Outlook.SendMailV2(
"empfaenger@email.com",
"Dein Betreff hier",
HTMLText.HtmlText
)

✅ Done! As soon as you click the button, the email will be sent to the recipient with clean formatting and dynamic content. 🎉
🚀 Bonus: Embed images in the email
If you want to integrate logos, icons, or images (e.g., from an email signature) into your formatted email, you can embed them directly in PowerApps.

1️⃣ Follow steps 1️⃣ to 4️⃣ and create an email with embedded images.
2️⃣ Upload the image as a .jpg to your Power App.

Make sure the file size is as small as possible to ensure optimal performance.
3️⃣ Save the image as a variable in the App.OnStart event and convert it with the following code:
Set(gblEMailBild, JSON(<DeinBild>, JSONFormat.IncludeBinaryData))

4️⃣ Find the image in the HTML code by searching for "src=".

5️⃣ Replace the original image source (src) with the variable gblEMailImage.
<img border=0 width=150 height=149 src="&gblEMailBild&">

✅ Now the image is inserted correctly into the email!

🎯 Conclusion
Without any HTML knowledge, you can use this method to send perfectly formatted emails with embedded images directly from PowerApps.
💡 My key learnings: ✔️ PowerApps can send beautifully formatted emails – without any code knowledge ✔️ Copy HTML from Outlook & use it directly in PowerApps ✔️ Easily replace dynamic content with & txtName.Value & ✔️ Integrate images into PowerApps via JSON conversion