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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sending QR Code via em...
Power Apps
Unanswered

Sending QR Code via email fails

(0) ShareShare
ReportReport
Posted on by

I am sending QR code image generated via api using 

Office365Outlook.SendEmail(User().Email;,"Your  QRcode is attached", HtmlText_QR.HtmlText,{Attachments:Myqr,IsHtml:true});

 

I checked that Collection Myqr contains the QR code image  named 'QRCode.jpg'

 

I placed code in  Htmltext_QR  as Img src='QRCode.jpg'

After clicking send button received below error 

 

Office365outllook send email failed.

 

If I use any other image it is working fine. May I know what could be the reason? How to fix this

 
 

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    on at

    Hi @Anonymous :

    Could you tell me what Myqr is?

    I'v made a test but did not encountered the problem you mentioned:

    1\Add a HtmlText control (HtmlText_QR) and set it's HtmlText property to:

    "<img src=https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=Hello%20world&choe=UTF-8>"

    2\Add a button and set it's OnSelect property to

    Office365Outlook.SendEmail(User().Email,"Your QRcode is attached", HtmlText_QR.HtmlText,{IsHtml:true});

    The Result:

    1.JPG

    In addition,I noticed that the error message in your screenshot is that the service is not responding.I suggest you check the network connection or change the device to test.

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-bofeng-msft ,

            Appreciate your response.  Myqr  is collection to store the image.

     

    I have tried your code it is sending email with QRCode but I need to pass the value in the qrcode URL string.

    In your url string you hard coded hello world.  Our requirement is to pass the text string entered by user 

     

    Example in HTML area

     

    "<img src=https://ddec1-0-en-ctp.trendmicro.com:443/wis/clicktime/v1/query?url=https%3a%2f%2fchart.googleapis.com%2fchart%3fchs%3d150x150%26cht%3dqr%26chl%3d" &textfield - Returns empty qr code

  • v-bofeng-msft Profile Picture
    on at

    Hi @Anonymous :

    Do you want to convert dynamic characters into QR codes?

    I've made a test for your reference:

    1\Add a text input control(TextInput2)

    2\Set HtmlText_QR's HtmlText property to

    "<img src=https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=Hello%20world"&TextInput2.Text&"&choe=UTF-8>"

     3\Button's OnSelect

    Office365Outlook.SendEmail(User().Email,"Your QRcode is attached", HtmlText_QR.HtmlText,{IsHtml:true});

     1.JPG

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-bofeng-msft ,

           It is working if my text input field is in the same screen. If my text input screen is in previous screen it is not working. But I am still able to refer the field in the code but value is missing in the QR code image. Anything I am missing?

     

     

  • v-bofeng-msft Profile Picture
    on at

    Hi @Anonymous :

    The values of controls and global variables can be referenced across screens.The situation you said may be because you called a context variable.I suggest that you can save the data in a global variable, and then call this global variable in your second screen.

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-bofeng-msft,

            It is also textinput field if I refer in other fields it is working not sure why it is not working in htmlarea. 

    May I know how to assign text input value to global variable?

  • v-bofeng-msft Profile Picture
    on at

    Hi @Anonymous :

    I've made a test but it worked well.

    61.gif

    If the problem persists, I suggest you save the value of textinput into a global variable.For example:

    Set TextInput2's OnChange property to:

    Set(thevar,TextInput2.Text)

    In this way, as long as the input in TextInput2 changes, the changed value will be saved in the variable thevar.

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-bofeng-msft ,

      I found the issue if I use functions to populate value it is not getting passed in to HTML area. If we use manually typed text it is getting passed . This is applicable even if I use global, context variables.

     

    Below is the function I am using to populate text field

    Office365Users.UserProfile(User().Email).GivenName

     

    I have 8 text fields which populate job title, postal code,... from Active directory

     

    Any other solution?

  • v-bofeng-msft Profile Picture
    on at

    Hi @Anonymous :

    Could you describe your app in detail?Some Screenshots?

    Best Regards,

    Bof

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard