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 / How To: Powerapp build...
Power Apps
Unanswered

How To: Powerapp builds HTML to Office365.SendEmail w/ Inline image

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Thanks in advance to anyone who can provide insight! 🙂

 

Building a powerapp that walks a user through a series of screens to collect responses. Those responses then get compiled into an HTML input box for the purpose of then using the HTML input box as the body of an email sent via Office365.SendEmail. 

 

The problem I am trying to solve is this:

I need to add a logo image inline within the HTML so that the image displays inline in the sent email. Within the company O365 / exchange environment a simple <img src.... tag does not display the image itself in the email. Regardless of the URL being internally / internal publicly accessible or externally hosted.

 

Details:

Final button function is:

Office365.SendEmail(Office365Users.MyProfile().Mail & ";" , var_EmailSubject,(HtmlText_EmailBody.HtmlText),{Importance: Normal, Cc: var_EmailCC1 & var_EmailCC2,IsHtml: true})

 

Example of body content:

<table>

<tr>

    <th><!-- logo image --></tr>

    <th>text</td>

</tr>

<tr>

    <td>text</td>

    <td>gathered text</td>

</tr>

</table>

 

Categories:
I have the same question (0)
  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    @Anonymous, it sounds like you want to send an email with HTML content.

     

    I know the perfect expert who has tinkered with scenarios like this-- @KickingApps! She has experience with different methods and caveats that can be very helpful.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks for the reply @Mr-Dang-MSFT !

     

    That's what I am trying to do:) However I need the image to be embedded in the email rather than just an HTML <img> tag that points to a web resource. MS Outlook does not want to render the image when it's done as an <img> even if the source is within the intranet and publicly available on a website, sharepoint, etc. There isn't even a "load this content" option for items like this. 

     

    I looked at the send email code for attachments, but how do you get the attached image inline? It's not useful in this scenario to simply attach the image to the email. Presentation is the focus.

     

    Is there a different email function? Trying to avoid also implementing MS FLOW just for this single inline logo image...

  • KickingApps Profile Picture
    628 on at

    @Mr-Dang-MSFT - Thanks for the mention. 

    @Anonymous - Sorry I am just replying; I haven't checked community in awhile. I will take a look at this as soon as I can get some time. (Promising to prioritize).

  • KickingApps Profile Picture
    628 on at

    @Anonymous In the below, I refer to links in my HTML text and the image is the email body. Is this what you have in mind?email.jpg

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @KickingApps thanks for taking the time to help me with this!!

     

    Yeah the end goal is to have inline displayed images in the email much like you have displayed. The problem I am running into is that within the corporate O365 environment when I use a powerapp to build the HTML code (html table in this case) that inclues an image in one of the table cells, the image does not display in the email when it's an <img src=....> html tag. I get the image not loading icon in the received email. 

     

    2019-10-24 07-49-55_Cortana.png

     

    I don't want to use the (example, not my code)

    {Attachments:Table({Name:"file1.jpg", ContentBytes:Camera1.Photo, '@odata.type':""})}

    Since that just attaches it to the email in Outlook, rather than displaying it inline. 

     

    The <img src> tag URL being used is an image on the corporate Intranet, and universally available within the company intranet. 

     

    All that being said the PowerApp I have built includes said Image as part of the PowerApp UI. So the image is part of the media / collection of the PowerApp as well. I just don't know how to embed the image inline when using the 

    Office365.SendEmail(Office365Users.MyProfile().Mail & ";" , var_EmailSubject,(HtmlText_EmailBody.HtmlText),{Importance: Normal, Cc: var_EmailCC1 & var_EmailCC2,IsHtml: true})

     

    (Note: The PowerApp gathers information and stores them in a number of variables using the previous screens selections made by the user. It then builds an HTML output which is the "HtmlText_EmailBody.HtmlText" above. And that is then used as the email body being sent via the "Office365.SendEmail..." function. 

     

    Hope this clarifies better! Any and all help would be appreciated! If I have to drastically change the workflow or path to generating the email contents that is totally fine! Anything to get the desired output is great!

  • KickingApps Profile Picture
    628 on at

    @Anonymous - Add you photos to a collection in your app. Then put this in you your html code:
    "<table>
    <tr>
    <td valign='Top'>
    <img src=" & Image & " style=""width:300px;height:250px;"">
    </td>

    </tr>
    </table>"

     

    For me, Image is the name of the column in my collection where the actual image is stored. Let me know how it goes. I

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @KickingApps To my shame I am struggling with the call to the collection as you noted.

     

    The app has the logo image on all the screens as a media asset. I then try to load that logo into a collection (I have tried to pull that image from screens to add to the HTML and that fails to be part of the email as well). I notice in the collection the picture is not under the image column, but rather the URL column. 

     

    All that being said I am working on the HTML code and struggling with the syntax. The wizard auto fill text is not helping either in this case.

     

    "<tr>
    	<th>
    		<img src=""" & Collection1[what goes with this?] & """ style=""width: 200px; height: 200px;"" />
    	</th>
    	<th>
    		<img src=""" & 'Logo' & """ style=""width: 200px; height: 200px;"" />
    	</th>
    </tr>"

    It amazes me that it's this hard to include native media from the app into the HTML email! arrgh!!! 

     

    Any and all help is MUCH appreciated!

     

  • KickingApps Profile Picture
    628 on at

    First, let me begin by apologizing. I realized I left a few things out in my haste to get you a reply.  That said, I hope this helps you acheive your goal. If you have questions, reach out and I will help you work through it.

    Thanks.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @KickingApps 

    Reviewing! Keep you posted!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @KickingApps - Appreciate your time here, I hope I am not wearing your patience thin!

     

    I am working through the solution you provided and I'm running into some confusion.

     

    1. I uploaded the Logo image file into the media section of my PowerApp (filename "Logo").
    2. From there I had to adjust the syntax you provided in (1) to clear the error. It didn't like the First().

     

    (1) - I got working

    ClearCollect(
     colLogo, 
     Logo //this is my image from the media section
    )

    (2) - I verified the image from the media section was collected into the Collection and part of the gallery. Note: I had to change the image property to the below in order to get the image to display on the screen. Else it had an empty image box.

    ThisItem.Url

    (3) - The htmlbox is not reporting any syntax errors, however it's displaying completely empty... 

    "<table>
     <tr>
     <td valign='Top'> 
     <img src=" & Image & " style=""max-width:100%;max-height:100%;""> // The "image" listed here is the object name from the gallery? If that is the case then it matches!
     </td>
     
     </tr>
    </table>"

    2019-10-25 13-20-21_Cortana.png

     

     

    Again I appreciate you taking the time to assist me with this. It's such a silly thing to struggle with including an image, that's part of the available media in the app, in an outbound html email... Smiley Sad

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,033

#2
Valantis Profile Picture

Valantis 632

#3
11manish Profile Picture

11manish 607

Last 30 days Overall leaderboard