How to save an outlook mail to a local folder

How to save not just attachments but entire outlook mail to a local folder

Hi Athira,

First of all you need to read outlook email with get outlook mail activity. then use for each loop to select email then inside for each loop use “Save mail message” activity and it requires two parameters first-> mail item that is your foreach loop item element and second folder location where you want to save the email.

Hope it will work
image

1 Like

@Athira

You can check below

Hope this helps you

Thanks

1 Like

Thanks for your reply. But I was looking for saving in message format instead of eml.

Thanks

1 Like

@Athira

Hope this helps you

Mark as solution if this helps

Follow Link

Thanks

Thanks

You can change type in the folder path field write “.msg” instead of .eml then it will save in msg format.

No, it won’t! It’s still faulty EML

I considered to open a new question but this one is pretty spot on:

For days I have tried to save mails to files to then convert them into PDF. Tried several things and after a new Office365-oriented instruction from UiPath was released I were able to read mails. Each mail got validated and then saved as EML (remembered to set “Get As HTML”). Progress was great and the sky was blue …

Using the following:

  1. UiPath.MicrosoftOffice365.Activities.Office365ApplicationScope
  2. UiPath.MicrosoftOffice365.Activities.Mail.GetMail
  3. A ForEach to read the UiPath.MicrosoftOffice365.Models.Office365Messages
  4. UiPath.Mail.Activities.SaveMail

Then problems arose in the horizon. With a command line utility, I tried to convert the files into PDF, and the structure was accepted but was not correct. The output got sender and recipient right, but the core was a lot of EML-tags. I compared with an Outlook saved MSG-file convert-ed to EML and the header-section lacks a lot. It looks like I cannot use this approach. I’m back to square one and consider the options:

  1. Create a C# project (activity/stand-alone) that reads the mails and saves them into a folder, where UiPath can pick them up.
  2. Use the existing setup but try to replace the UiPath.Mail.Activities.SaveMail-activity with my own version that saves the UiPath.MicrosoftOffice365.Models.Office365Message-type data to a file as an MSG.

I’m rather disappointed that I must struggle with this rather banal problem. Why can’t I just save the mail as MSG? Why hardcoded to apparently a flawed EML format?

on which format you want to save the email?

Sorry for being unclear on that. MSG is the format I want.

Did you check the answer from @ksrinu070184 above.

No, my browser kept looping when trying to enter page. Now fixed. Looks promising.
BTW: Had to register a country to my profile. Wrote “Denmark” and found 4 in USA and 1 in Australia. Then wrote “Danmark” and 1 in both USA and Australia were found. Apart from these two, a third “Danmark, Sweeden” appeared. Does that mean that Denmark now is part of Sweeden or that we share the line? Never mind, that’s the one I selected. Had a small laugh though.

Tried downloading but: 1. Can’t find MsgKit, that is, found link but DL disappears, probably removed by AntiMalWare software. 2. Getting the “Mail Message Converter” resulted in zero-byte files. This project is like climbing a mountain.

Btw. I’m using C# and the converter is Visual Basic compatible.