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

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Embed photo in SendEmailv2

(1) ShareShare
ReportReport
Posted on by 131
I am building an app for work that uses Dataverse. I currently already have an app built for them using SharePoint, but I am trying to 'level it up' by using Dataverse.
 
For example, I have a screen that submits a form, "CorpDetailsFrm" and in that form, users enter various bits of info, including attaching a photo file as a document. Upon hitting the 'submit' button, the form submits the data to the Dataverse table "BTS_Projects." The column in the table BTS_Projects that receives the photo file, is called "Client_Documents_Column" ... the column's data type is 'file.'
 
When I hit the 'submit form' button, my app is also triggered to send an email. I've done this before and seems pretty straightforward... until I want to embed the photo file in the body of the email.
 
Everywhere on the internet immediately defaults to using flows with Power Automate. Is this my only option?
 
If anyone has any advice or blogs, etc., I'm all ears.
 
Thanks in advance,
Kristine
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Robu1 Profile Picture
    1,411 Super User 2025 Season 2 on at
    Embed photo in SendEmailv2
     
    Hi ,
     
    Thank you for choosing Microsoft Power Platform Community.
     
    I hope these steps help resolve the issue!
     
    If you want to embed a photo from Dataverse into an email, use Power Automate to:  Get the photo from Dataverse
    Convert it to base64, embed it in the email using HTML like: data:image/jpeg;base64,@{base64(outputs('Get_file_or_image_content'))}
     
    If you need more specific guidance, feel free to ask. If this fixes the issue, please mark as resolved to help others with find it.
     
    Check out these resources too:
     
     
     
    ✅ Please click Accept as Solution if my post helped you solve your issue and help others who have a similar issue.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
     
     
    Happy to help,
     
    Robu 1
    SuperUser S2: 2025
    Moderator
     
     
     
  • kristinegriba Profile Picture
    131 on at
    Embed photo in SendEmailv2
    Thanks, @Robu1, however, this looks like a flow. Is this my only way to accomplish this?
  • Suggested answer
    Robu1 Profile Picture
    1,411 Super User 2025 Season 2 on at
    Embed photo in SendEmailv2
    There are other approaches. Let me know which option you would prefer.
     
    Custom Connector + Power Apps + SMTP or Graph API:
    Use Power Apps to collect and encode the image, then pass it to a custom connector that sends the email via SMTP or Microsoft Graph. Offers flexibility and control, but requires setup and secure credential handling.
     
    Dataverse SDK (.NET):
    Use the SendEmailRequest class to send emails directly from backend code. You retrieve the file, encode it, and embed it using HTML or CID. Best for enterprise apps with .NET infrastructure.
     
    Microsoft Graph API
    Retrieve the file from Dataverse via Web API, then use Graph API to send an HTML-formatted email with the embedded image. Scalable and modern, but requires token management and permissions.
     
    Azure Logic Apps
    Similar to Power Automate but more enterprise-focused. You can build workflows that retrieve the file and send emails with embedded images. Offers better DevOps integration and versioning.
     
    Azure Functions triggered by Power Apps
    Use Power Apps to trigger an Azure Function that handles file retrieval and email sending. Lightweight and customizable, but requires coding and secure setup.
     
    Direct Web API call from Power Apps
    Call an external email service (like SendGrid or Mailjet) directly from Power Apps using a Web API. You pass the base64 image and email content in the request. Fast but requires external service integration.
     
    Third-party platforms (e.g., Make, Zapier)
    Use automation platforms to connect Dataverse and email services. Limited control but useful for quick setups or non-Microsoft environments.
     
     
    I hope these help.
  • Suggested answer
    WarrenBelz Profile Picture
    151,637 Most Valuable Professional on at
    Embed photo in SendEmailv2
    Put your image in an Image control and do this
    Office365Outlook.SendEmailV2(
       "To: address here",
       "Subject here",
       "<p>Message body here</p><img src='" & 
       Substitute(
          JSON(
             ImageControlName.Image,
             JSONFormat.IncludeBinaryData
          ),
          """",
          ""
      ) & "'><p>Salutation here</p>"
    );
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful?
    Visit my blog
    Practical Power Apps    LinkedIn  
  • WarrenBelz Profile Picture
    151,637 Most Valuable Professional on at
    Embed photo in SendEmailv2
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn   
  • kristinegriba Profile Picture
    131 on at
    Embed photo in SendEmailv2
    @WarrenBelz Hey Warren thanks for checking in and sorry for my delayed reply. I got caught up experimenting with this issue and trying different things, and I think I'm coming to the conclusion that I'll have to resort to creating a flow with Power Automate. I've not done that before and am now watching some intro YouTube videos on flows... because I am not looking forward to it :( Wish me luck LOL cuz I'm not having much faith that that will work either as it seems quite complicated. I didn't think embedding a photo inline in the body of an email would be this difficult, but alas, here we are... besides, what do I know... I consider myself a beginner with Power Apps with only a little bit of experience under my belt. I guess that's why I'm thankful for these forums. Thanks again for your assistance and checking in.
  • WarrenBelz Profile Picture
    151,637 Most Valuable Professional on at
    Embed photo in SendEmailv2
    Not sure why you need a flow as the solution there is exactly the same (send the image to the flow and then use the same HTML I posted to embed it), so actually more work. If you want to attach it instead of embedding it, that can also be done directly from Power Apps.
  • kristinegriba Profile Picture
    131 on at
    Embed photo in SendEmailv2
    Hi @WarrenBelz Flows do seen VERY complicated... I think I'm back to trying to get this to work your way. As I mentioned, I did some experimenting... I couldn't quite get your code to work so that is how I started trying different things. Anyway, below is a screen capture showing the code in the Onselect property of my 'submit' button, and then the resulting email's body/content.
     
    There are some variables set and a Submit(Form() before the sendmailV2 code. The form submitted includes the "Tap or click to add a picture" photo/media control.
     
    The jpeg submitted with the form I was hoping to show inline in the email body, but it is giving me a broken image icon instead :( I feel like it's very close... thoughts?
     
  • Suggested answer
    WarrenBelz Profile Picture
    151,637 Most Valuable Professional on at
    Embed photo in SendEmailv2
    Can you please remember to post your code in Text - saves re-typing here. 
    I set up Variables with the same names and content as yours
    UpdateContext(
       {
          varCorpDetail_Client: "Test Client",
          varCorpDetail_projectName: "2026YE Audit",
          varPN: "25029",
          varYEcorp: Date(2025, 9, 30),
          varELcorp: "To be sent out for signing at a later date",
          varBase64Image: 
          Substitute(
             JSON(
                DocPhoto.Image,
                JSONFormat.IncludeBinaryData
             ),
             """",
             ""
          ),
          varNOTEScorp: "Testing for embedded jpeg",
          varPhotoName: "2025-10-29 Rod & Gun Club SMALL.jpg"
       )
    )
    and then ran this
    Office365Outlook.SendEmailV2(
       User().Email,
       "NEW WORK BASKET ITEM: " & varCorpDetail_Client,
       "<html>
          <body>" &
             "<p>Please Assign This New Work</p>" &
             "<b>CLIENT:</b> " & varCorpDetail_Client & "<br>" &
             "<b>PRODECT NAME :</b> " & varCorpDetail_projectName & "<br>" &
             "<b>PROJECT NUMBER:</b> " & varPN & "<br>" &
             "<b>APPLICABLE FISCAL YEAR END:</b> " & Text(varYEcorp, "mmmm d, yyyy") & "<br>" &
             "<b>ENGAGEMENT LETTER STATUS:</b> " & varELcorp & "<br><br>" &
             "<b>Base 64 String Length:</b> " & Len(varBase64Image) & "<br><br>" &
             "<b>NOTES:</b><br> " & varNOTEScorp & "<br><br>" &
             "PHOTO FILE NAME: " & varPhotoName & "<br><br>" &
             "<img src='" & varBase64Image & "'width='300'/>" &
          "</body>
       </html>"
    )
    and received the email with the photo embedded as expected.
     
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 632 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 386 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 245 Moderator

Last 30 days Overall leaderboard