How to convert .eml file to .msg file without using custom UiPath Package/Activities?

How to convert .eml file to .msg file without using custom UiPath Package/Activities ?

1 Like

why u cannot use custom activities?

  1. open .eml file with outlook.
  2. click file > save as> save or use hotkeys (alt+f, a, enter)

its project restriction that is not allowing me to use custom activities.

I cant use this solution as machine dont have outlook installed on it. It may have some reliability issue. Is there any vb script , c# or python script to achieve this.

I referred this link. I was not able to run that. If you can share your piece of code that would be great.

Hi Nikhilesh,
You are right, it requires a library and I guess you restriction in custom plugins also extends to libraries. All solutions I found seem to require a Library or something extra. Not sure it can be done with C# or Python (probably it would require you to install some library which again breaks the point of custom activities). Bad Solution: Maybe you just need to rethink the problem. You could read as TXT the eml file and build the mailmessage and save it as MSG(?)

1 Like

.msg is a proprietary format from Microsoft, no matter how you slice it you will need outlook or the office binaries installed.
you could check out the OOM (Outlook Object Model) and try to use that in powershell.
Good luck

You can use Interop to handle this, please find below namespaces

Microsoft.Office.Interop.Outlook.Application
Microsoft.Office.Interop.Outlook.NameSpace
Microsoft.Office.Interop.Outlook.MAPIFolder
Microsoft.Office.Interop.Outlook.MailItem
Microsoft.Office.Interop.Outlook.Application
OutlookNamOutlookApp.GetNamespace(“MAPI”)

then you can use .save as (folder & filename.msg)

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.