web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Attachments and Embedd...
Power Apps
Answered

Attachments and Embedding Images when sending emails

(1) ShareShare
ReportReport
Posted on by 11

I am trying to utilise Office365Outlook.SendEmail but having issues passing attachments and embedding an image in to the body of the email.

 

Firstly, I have an attachment control DataCardValue4 that I am unable to pass to the function successfully.

 

Secondly, I am trying to build the body of the email using elements from my app. The main thing that I am trying trying achieve is to embed an image that is collected from a Pen Input.

I am looking to build the body of the email using:

Input_Summary.text

Input_Name.text

PenInput1.Image

DatePicker1.SelectedDate

 

My main focus here is how to successfully get the pen Input in to the email body as PenInput.Image just gives me a blob text string.

 

Thanks in advance

Categories:
I have the same question (0)
  • Verified answer
    Rajkumar_404 Profile Picture
    on at

    Hi @Astivey 

     

    Convert the Pen Input image to a base64 string.

     

    JSON(PenInput1.Image, JSONFormat.IncludeBinaryData)

     

    Create the email body HTML, embedding the Pen Input image:

     

    "<html><body>" &
    "<p>Summary: " & "HI" & "</p>" &
    "<p>Name: " & "Hello" & "</p>" &
    "<p>Date: " & Text(DatePicker1.SelectedDate, "dd/mm/yyyy") & "</p>" &
    "<p>Signature:</p>" &
    "<img src=" & JSON(PenInput1.Image, JSONFormat.IncludeBinaryData) & " alt='Signature' />" &
    "</body></html>"

    Use the Office365Outlook.SendEmailV2 function with the formatted attachments:

     

    Office365Outlook.SendEmail(
    TextToEmail.Text,
    TextEmailSubject1.Text,
    "<html><body>" &
    "<p>Summary: " & Input_Summary.text & "</p>" &
    "<p>Name: " & Input_Name.text & "</p>" &
    "<p>Date: " & Text(DatePicker1.SelectedDate, "dd/mm/yyyy") & "</p>" &
    "<p>Signature:</p>" &
    "<img src=" & JSON(PenInput1.Image, JSONFormat.IncludeBinaryData) & " alt='Signature' />" &
    "</body></html>",
    {
    Attachments: Coalesce(
    RenameColumns(
    DataCardValue27.Attachments,
    Value,
    ContentBytes
    )
    )
    }
    );

     

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.

     

  • Astivey Profile Picture
    11 on at

    Perfect. Thank you for your help.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard