cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Exporting HTML content to MSG or EML

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Exporting HTML content to MSG or EML

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,

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Exporting HTML content to MSG or EML

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,

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper I
Helper I

Re: Exporting HTML content to MSG or EML

Download ZOOK MSG to EML Converter to convert Outlook MSG files to EML format along with attachments. It easily batch export MSG to EML to save multiple Outlook emails to EML format. It is the best solution for users to bulk convert MSG to EML file by saving MSG as EML format. It is the simple, direct and trustworthy solution for home users as well as for enterprises to export MSG to EML format. The tool enables user to convert MSG files of any Outlook editions such as Outlook 2016, 2013, 2010, 2007, 2003, etc. MSG to EML Software has so simple interface which is the reliable solution for any non-technical users to export Outlook MSG to EML with attachments in few moments without any extra efforts.

Explore More:- https://zook-msg-to-eml-converter.soft32.com/

MSG to EML Converter.png

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,418)