Saving Graph Message into .MSG or .EML file - microsoft-graph-api

I am working on using MS Graph
https://graph.microsoft.com/v1.0/me/mailFolders/{folderID}/messages/{messageID}
to extract email messages. I have a requirement to save the email (message, attachments, etc) into a .MSG or .EML format.
I am having trouble finding anything that can help me do this. Any ideas? I know I can get the MIME value but not sure if that is enough or I need to do more.

You won't be able to save a Message in the MSG file format as this is an Office file format (Compound Binary format https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cfb/53989ce4-7b05-4f8d-829b-d08d6148375b)
For EML yes all you need is the MIMEContent
GET /users/{id}/messages/{id}/$value
And save that as a file with .eml extension
That said the MIME content of the message doesn't provide full fidelity on the Message as it won't include any extended MAPI properties. But this is generally only important for Mail Migration and Backup type applications for general use EML should be fine

Related

Orbeon Form - save PDF and XML in local file share after submit/save

Currently I have got Orbeon to send an email to me with a PDF and an XML attachment. Is there a way to get Orbean to also save the submitted form as PDF and XML files in a local (or remote) file share somewhere for further processing?
It's not possible to save to the filesystem at the moment. But you can use the send action to send XML and or PDF to a service.

Can we include attachments to iCalendar invitations that are created from an MVC application

How can we send attachment along with an ics file that are created from MVC application.
We are creating the meeting invitations with data fetched from application in ics format and then downloading for the user to click on it and open in outlook.So can we add an attachment also along with the ics file so that users wen open in outlook will see the attachment along with other details.
Please somebody help.
As per https://www.rfc-editor.org/rfc/rfc5545#section-3.8.1.1 or https://icalendar.org/iCalendar-RFC-5545/3-8-1-1-attachment.html, one can ATTACH by referring to the URL of the attachment.
An example given is:
ATTACH;FMTTYPE=application/postscript:ftp://example.com/pub/
reports/r-960812.ps
Other examples elsewhere in the spec are:
ATTACH:http://example.com/public/quarterly-report.doc
or
"The following example specifies an "ATTACH" property with inline
binary encoded content information:
ATTACH;FMTTYPE=text/plain;ENCODING=BASE64;VALUE=BINARY:VGhlIH
F1aWNrIGJyb3duIGZveCBqdW1wcyBvdmVyIHRoZSBsYXp5IGRvZy4
"
or
ATTACH;FMTTYPE=application/msword:ftp://example.com/pub/docs/
agenda.doc

Node.js - Download .docx file exported as html from onedrive using microsoftgraph api call

When making a call like this example from here
client
.api('/me/drive/root/children/Doc.docx/content')
.getStream((err, downloadStream) => {
let writeStream = fs.createWriteStream('Mydoc.docx');
downloadStream.pipe(writeStream).on('error', console.log);
});
It works as expected. What I want is to get the .docx file as html. Is there any way to download it in html format? Or do I have to save the file and then try to export it to html. Thanks
Word Documents (.docx) do not use HTML, they use Office Open XML (OOXML). Technically they are a zipped package that contains several elements along with the raw OOXML of the document.
OneDrive itself does not provide any document conversion tools, it is just the cloud storage the document is stored in.
In order to convert a document from one format to another (OOXML to HTML for example), you'll need to use a 3rd party tool or service for that purpose. I'd suggest taking a look as Aspose. They offer a slew of file format conversion tools including one for Word. I've had a number of developers report good results using their Aspose Cloud services as well.
You can add the query parameter format=html to download in html format but supposedly you have to use the beta endpoint.

Openvms mime content/encoding for an .xlsx file

We have created a utily that - using MIME - allows us to send emails using the VMS MAIL utility that include various types of file as an attachment. So far it works for PDF, text xls, doc and zip files.
However we are unable to get it to work for the newer .xlsx excel files. We can send it OK and when you open the email up it all looks as it should, the little .xlsx icon is right there etc ... But when we actually click on it to try to open it up , excel simply says the file is in an unreadable format.
I wonder if anyone has any experience of getting this to work ok or can suggest a solution.
Ok, so here is the answer to my own question.
First of all the VMS engineer guys are accepting that mime has a bug which prevents it from encoding native .xlsx (and possibly other new office format files).
The workaround we did was to zip the .xlsx with a recent version (circa 2006) of zip on our openVMS box, using the "-V" option. We could then "mimeify" the zip and send on using VMS Mail. We found that we could then open the zip in the target email client and read the attached .xlsx spreadsheet OK.

To retrieve the contents of .doc files?

I am working as a Software developer for Mobile Applications. I am developing an application in which i want to retrieve the contents of the .doc files that arrive on the Blackberry mobile as an Email Attachment Part. Whenever i am retrieving the contents of the .txt files, the code written for the mobile is retrieving the accurate contents but in case of .doc files, it is displaying a lot of junk material in the header and footer of the actual contents.
So, my problem is that how can i get rid of this additional junk material as i want to retrieve only the actual contents of the .doc files. Please reply
Thanks
You can get the specifications of the doc-Format from Microsoft. Though, I don't know if they're complete or even useful. Another guess would be to have a look at Projects which have implemented it, like OpenOffice.org.
Bobby

Resources