
Announcements
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 linkIs there anyway to achive this?
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,