Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Send Email Screen with Image

(1) ShareShare
ReportReport
Posted on by 4,447
I am trying to use the Power Apps default email screen.

I can get the email to send.

I want to send an image with the email.

However, when I add an image (the Add Picture Control shown on the right) and
send, the email presents the long blob storage string rather than the image.

What am I missing?

How do I update the formula so that the image appears in the email?

Also, is it possible to use the Gallery shown with an 'Add Picture' control within
in the send email scenario? 
 
Set(_emailRecipientString, Concat(MyPeople, Mail & ";"));          
Office365Outlook.SendEmail(_emailRecipientString, TextEmailSubject1.Text,
"<img src="& JSON(UploadedImage1.Image, JSONFormat.IncludeBinaryData) &
"></img></br></br>"& RTE_Body.HtmlText, {Importance:"Normal"});  
 
  • timl Profile Picture
    timl 33,150 on at
    Send Email Screen with Image
    Hi Phineas,
     
    I'm glad that worked. 
     
    Yes, that's possible to send multiple images. Taking the easier example, the formula with 3 'freestanding' add image controls would look like this.  
     
    Office365Outlook.SendEmailV2(_emailRecipientString, TextEmailSubject1.Text,
      "<img src="""& Substitute(JSON(UploadedImage1.Image, JSONFormat.IncludeBinaryData), """","") & """></br></br>" &
      "<img src="""& Substitute(JSON(UploadedImage2.Image, JSONFormat.IncludeBinaryData), """","") & """></br></br>" &
      "<img src="""& Substitute(JSON(UploadedImage3.Image, JSONFormat.IncludeBinaryData), """","") & """></br></br>"
     , {Importance:"Normal"});  
    
     
    With a gallery, you would ForAll through the gallery's AllItems property and build the <img> tags from within.
  • Phineas Profile Picture
    Phineas 4,447 on at
    Send Email Screen with Image
    Yes, that worked. Thank you.

    Can the Gallery with an Add Picture control (for multiple pictures) be used in the same way. with an updated formula?

    Or can two or three 'freestanding' Add Image Controls be strung together in a formula where more than one image
    needs to be sent?
  • Verified answer
    timl Profile Picture
    timl 33,150 on at
    Send Email Screen with Image
    Hi @Phineas
     
    In addition to calling V2 of SendEmail, you'll need to strip the enclosing quotes that are included when you call JSON.
     
    The formula that removes them would look like this:
    Office365Outlook.SendEmailV2(_emailRecipientString, TextEmailSubject1.Text,
    "<img src="""& Substitute(JSON(UploadedImage1.Image, JSONFormat.IncludeBinaryData), """","") &
    """></br></br>"& "test", {Importance:"Normal"});  
     
    To clarify what Mark Nanneman says, you don't need the *closing* image tag ("</img>"), however, the image tag is still required for the image to appear.   
  • Phineas Profile Picture
    Phineas 4,447 on at
    Send Email Screen with Image
    Switched to V2. No more error, but got the same blob string, whether I used the gallery or the stand-alone 'Add Picture' control.


    Tested the following. 
    Set(_emailRecipientString, Concat(MyPeople, Mail & ";"));          
    Office365Outlook.SendEmailV2(_emailRecipientString, TextEmailSubject1.Text, JSON(UploadedImage1_1.Image,JSONFormat.IncludeBinaryData) &  RTE_Body.HtmlText, {Importance:"Normal"});          
    Reset(TextEmailSubject1);          
    Reset(RTE_Body);          
    Clear(MyPeople)
  • Suggested answer
    Mark Nanneman Profile Picture
    Mark Nanneman 831 on at
    Send Email Screen with Image
    Try using Office365Outlook.SendEmailV2
    to send actual HTML in an email.

    Also, you don't need the </img> for an HTML image element.  

    https://www.w3schools.com/tags/tag_img.asp

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

Kickstarter Events…

Register for Microsoft Kickstarter Events…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,858

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,505

Leaderboard