cancel
Showing results for 
Search instead for 
Did you mean: 

‘Natively’ reading an offline ‘.eml’ file

stepher
Level 6

This is one of those questions where I think I already know the answer, but I am really hoping that someone can dissuade me from this path.

Is there a way to ‘natively’ read an ‘.eml’ file (saved offline)?

My preferred option, ‘Microsoft 365 – Outlook’, can save an email as an ‘.eml’ file, but does not seem to be able to read from the same file.  The MS Outlook VBO does process offline ‘.msg’ files, but there is converting between the two formats, and, really, we are trying to get away from needing Outlook installed on our Runtimes as a long-term goal.

So… my current path, and I can already feel my skin itching, is to take the ‘.eml’ file and read it as a text file. Then, using some combination of RegEx and text logic, parse out the bits and pieces that I need.  It would all be there, but so would all the MIME, SMTP and other esoterica that I would rather not see.  Plus, I am already bracing for the fact that each Sender has their own term for concepts (‘Your Purchase Order’, ‘Your PO Number’, ‘PO#’, etc.), which just adds to the fun.

Anyway, if you have any ideas, I would be grateful.

Thanks much,

Red

Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA
4 REPLIES 4

Hi @stepher 
I copied the .eml  file from the following GitHub repository and converted it into a text file manually and also tried using utility file management copy action 
GitHub - Dummy EML File

harishmogulluri_0-1732401709447.png

 

So i think  you can  try Depending on the format of the email, you can convert the file to either a text or HTML file and then read the data from there.

-----------------------
If I answered your query. Please mark it as the Best Answer

Harish Mogulluri

GeoffHirst
Staff
Staff

Hey Red,

eml files, these are quite a task. Even though they really shouldn't be. So, the story is, as far as my understanding goes, eml files are produced when saving an email from outlook on the web. This is the only place I have come across them. I actually did the recent update to the Outlook VBO adding that read eml action, so I am remembering here. At the time, I wasn't convinced there was any facility in the object model to actually read these files, but there is. However, writing them is another matter. I did look at some of the third party libraries for doing this but we decided that we didn't want to make a core VBO more complex than it would need to be. Now, I remember at the time looking at MsgReader and MsgKit on nuget and Github, respectively. Like I say though we decided that it would make it more complex for a core vbo to have dependencies on yet another dll. So, we halted the development at reading.

This isn't to say you couldn't pursue this direction yourself as I would think this would potentially be a way of doing what you want, but I haven't tried it personally. I was originally looking for a way to read eml files as that was what we had been asked for.

So, I hope this at least helps a little. Come back to me if you need more.

regards

 

Geoff Hirst Senior DX Engineer - Digital Exchange - EMEA SS&C Blue Prism

Hello Harish,

I can ingest the '.eml' file into Blue Prism, as is, without any difficulty.  This was identical to renaming the file as '.txt', so other than differentiating the original from the working file, there was no advantage.  I also renamed it as '.html' and that does remove some of the formatting noise, but it seems like I am dependent on the formatting from the multiple senders being consistent.  This still in consideration, but I think I might be just as well off working from the original format.

I do appreciate the response.  Thank you,

Red

Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA

Hey Geoff,

As always, it seems that you and your team are one [or more] steps ahead of me.  I had actually downloaded the latest version of the MS Outlook VBO (v10.4.5), but had not done anything with it yet.  Thus, I missed the addition of the 'Read From EML' action.  Let me look into it, and I will report back.

Thank you so much,

Red

Robert "Red" Stephens Application Developer, RPA Sutter Health Sacramento, CA