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 / Exporting HTML content...
Power Apps
Unanswered

Exporting HTML content to MSG or EML

(0) ShareShare
ReportReport
Posted on by 98

Hello,


I have a basic application with a form that i then organise in a HTMLText box later on. I have a button that will then send the HTML contents via email using the Office365.SendEmail(). All this works just fine, however I would like to have a contengency option in the case where Office365.SendEmail() fails me, I need to be able to export the HTML content to a MSG or an EML file.

This would allow my users to have a second fail safe to manually generate the email instead of fully relying on powerapps' Office365 functions.

In javascript I would be able to do something like:

var emlContent = "data:message/rfc822 eml;charset=utf-8,";
emlContent += 'To: '+emailTo+'\n';
emlContent += 'Subject: '+emailSubject+'\n';
emlContent += 'X-Unsent: 1'+'\n';
emlContent += 'Content-Type: text/html'+'\n';
emlContent += ''+'\n';
emlContent += htmlDocument;

var encodedUri = encodeURI(emlContent); //encode spaces etc like a url
var a = document.createElement('a'); //make a link in document
var linkText = document.createTextNode("fileLink");
a.appendChild(linkText);
a.href = encodedUri;
a.id = 'fileLink';
a.download = 'filename.eml';
a.style = "display:none;"; //hidden link
document.body.appendChild(a);
document.getElementById('fileLink').click(); //click the link

Is there anyway to achive this?

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

    Hi @Owizardo,

     

    As far as I know, there is no way to export the content when the Office365.SendEmail() action fails.

     

    But if you would like to export an Email already sent, then you may take use of the Export Email action through Microsoft Flow:

    Checking the following Microsoft Flow for more details about how to work with the Export Email action:

    Improvements to the Outlook connectors and more

     

    Best regards,

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard