Tutorials/Power Apps/Power Apps Email Automation: Send Outlook Messages with Precision
Power Appsintermediate

Power Apps Email Automation: Send Outlook Messages with Precision

A practical guide to building email capabilities in your canvas apps using the Office 365 Outlook connector, covering recipients, formatting, attachments, and more.

NA
Narmer Abader
@narmer · Published June 3, 2026

Imagine you've built a helpdesk ticket app in Power Apps. When an agent resolves a ticket, you want to automatically notify the requester with the resolution summary, attach supporting files, and maybe even include a satisfaction survey link. The Office 365 Outlook connector turns that vision into reality. In this guide, you'll learn how to send emails from your canvas app—starting with the basics and then layering on features like a people picker, CC/BCC, attachments, rich HTML formatting, and embedded images.

Everything you see here is built around a fictitious "Ticket Resolution" scenario, but the patterns apply to any app that needs to fire off a message.

1. Getting Started: The Minimum Viable Email

Add the Office 365 Outlook connector to your app (under Data → Add data). Then place these controls on a screen:

  • txtRecipient – Text input for the email address (or addresses separated by semicolons).
  • txtSubject – Text input for the subject line.
  • txtBody – Text input for the plain-text body.
  • btnSend – Button to trigger the send.

Set the button's OnSelect to:

powerfxBasic send
Office365Outlook.SendEmailV2(
  txtRecipient.Text,
  txtSubject.Text,
  txtBody.Text
);

That’s the simplest way. But real apps usually need more flexibility—let's upgrade step by step.

2. Using a People Picker for Internal Recipients

If you're sending to coworkers inside your organization, typing email addresses is error‑prone. Use a combo box connected to the Office 365 Users connector.

  1. Add the Office365Users connector.
  2. Insert a combo box named cmbTo.
  3. Set Items to:
powerfxSearch users
Office365Users.SearchUserV2({
  searchTerm: Self.SearchText,
  top: 10,
  isSearchTermRequired: false
}).value
  1. Set DisplayFields to ["DisplayName"], IsSearchable to true, and SearchFields to ["DisplayName"].
  2. Enable SelectMultiple so you can pick several people.

The OnSelect of your send button becomes:

powerfxSend to selected people
Office365Outlook.SendEmailV2(
  Concat(cmbTo.SelectedItems, Mail & ";"),
  txtSubject.Text,
  txtBody.Text
);

Concat joins all selected mail addresses with a semicolon, which the Outlook connector understands as multiple recipients.

3. Adding CC and BCC

Sometimes you need to copy a manager or send a blind copy to another team member. Add two more text inputs: txtCc and txtBcc. Then extend the SendEmailV2 call with an optional record:

powerfxSend with CC/BCC
Office365Outlook.SendEmailV2(
  txtRecipient.Text,
  txtSubject.Text,
  txtBody.Text,
  {
      Cc: txtCc.Text,
      Bcc: txtBcc.Text
  }
);

If you also use the people picker for To, simply apply Concat for those fields as well.

4. Attaching Files

Attaching a file is a two‑step process: collect the file(s) and then pass them in the Attachments parameter.

Using the Attachments Control

The built‑in Attachments control is normally part of an Edit Form. To use it standalone:

  1. Insert an Edit Form, connect it to any data source (e.g., a SharePoint list), and delete everything except the Attachments control.
  2. Rename that control to attFiles.
  3. Set its MaxAttachments property to, say, 5.

In the send button, loop through the control’s Attachments property:

powerfxAttach multiple files
Office365Outlook.SendEmailV2(
  txtRecipient.Text,
  txtSubject.Text,
  txtBody.Text,
  {
      Attachments: ForAll(
          attFiles.Attachments,
          {
              ContentBytes: Value,
              Name: Name
          }
      )
  }
);

Attaching a Single Image from an Add Picture Control

For a single image, use the Add picture control. Rename its child image control to imgSnapshot.

Set imgSnapshot.CalculateOriginalDimensions to true. Then attach it like this:

powerfxAttach one image
Office365Outlook.SendEmailV2(
  txtRecipient.Text,
  txtSubject.Text,
  txtBody.Text,
  {
      Attachments: {
          ContentBytes: imgSnapshot.Image,
          Name: "Snapshot.jpg"
      }
  }
);

5. Rich Text Formatting in the Body

Plain text is fine for internal alerts, but for customer‑facing emails you probably want formatting. The Rich Text Editor control (name it rteBody) produces HTML automatically.

Set the send button’s OnSelect to:

powerfxSend rich text
Office365Outlook.SendEmailV2(
  txtRecipient.Text,
  txtSubject.Text,
  rteBody.HtmlText
);

The editor supports bold, italic, bullet lists, font colours, etc.—all converted to valid HTML that Outlook renders.

6. Embedding Images Directly in the Body

Embedded images appear inline, not as separate attachments. Two approaches:

Via the Rich Text Editor

Users can drag an image file into the Rich Text Editor. The control stores the image as a Base64 data URI inside its HtmlText. You send the same way as above—no extra work.

Via the Add Picture Control

If you want to programmatically embed an image without requiring the user to use the editor, use the Add Picture control again. Build an `` tag with a Base64 data source.

powerfxEmbed image from Add Picture control
With(
  {
      imgData: JSON(imgSnapshot.Image, JSONFormat.IncludeBinaryData)
  },
  Office365Outlook.SendEmailV2(
      txtRecipient.Text,
      txtSubject.Text,
      "<html><body><p>Here is the image:</p></body></html>"
  )
);
Size matters

Base64‑encoded images increase the email size significantly. Limit embedded images to small diagrams or logos.

Dynamic content like a list of recent ticket updates often looks better as an HTML table. You can generate the HTML string in Power Fx using Concatenate or Concat.

powerfxGenerate an HTML table
With(
  {
      htmlTable:
          "<table border='1' cellpadding='5'>" &
          "<tr><th>Ticket</th><th>Status</th><th>Updated</th></tr>" &
          Concat(
              Filter(Tickets, Status = "Resolved"),
              "<tr><td>" & TicketID & "</td><td>" & Status & "</td><td>" & Text(ModifiedDate, "mm/dd/yyyy") & "</td></tr>"
          ) &
          "</table>"
  },
  Office365Outlook.SendEmailV2(
      txtRecipient.Text,
      txtSubject.Text,
      "<html><body>" & htmlTable & "</body></html>"
  )
);

To include clickable links, use standard anchor tags inside the HTML.

8. Performance and Security Considerations

  • DelegationOffice365Users.SearchUserV2 doesn’t have delegation warnings for the top parameter, but the result set is limited. For very large directories, consider using a different search approach.
  • Attachment limits – The MaxAttachments property only restricts the UI; there’s no server‑side limit in the connector, but email providers may cap total size (usually 25 MB for Exchange Online). Warn users about large files.
  • Sensitive data – The email body and attachments are sent in clear text unless your organisation enforces encryption at the transport layer. Avoid including passwords or personally identifiable information in plain‑text emails.
  • Error handling – The SendEmailV2 function returns a record but does not throw traditional errors. You can wrap it in an IfError check (if you're using Power Fx error handling) to show a notification on failure.

9. Common Pitfalls & Troubleshooting

ProblemLikely CauseFix
Email not sending; no error.The Outlook connector may not be added to the app.Go to Data → Add data and add Office365 Outlook.
People picker shows no results.Search string too short or connector missing.Set isSearchTermRequired to false and ensure Office365Users is added.
Attachments control won’t appear in the insert menu.It’s only available inside an Edit Form.Insert an Edit Form, then delete everything except the Attachments control.
HTML email shows as plain text.Missing <html> and <body> tags.Wrap your HTML content in <html><body>...</body></html>.
Embedded image doesn’t display in Outlook.Outlook blocks inline images by default.Users may need to enable “Download pictures” in Outlook settings.

10. Final Recommendation

Start simple: send a test email with only the recipient, subject, and plain body. Once that works, add one feature at a time—CC/BCC, attachments, rich text. The Office 365 Outlook connector is robust and well‑documented, but each addition increases complexity and potential failure points. Always test with a small, safe audience before rolling out to real users.

For a production app, consider adding a confirmation dialog before sending and a way to review the email content (including attachments) in a preview screen. Your users will thank you.

References