How to read saved outlook emails from local folder

Hi all,

I have a problem statement where I need to Read all the saved outlooks emails (.eml.msg) files and extract the values like body, subject and attachments(similar to what an outlook activities does).

Could anyone please help with an approach?

Thanks In Advance!
Bishwajeet Kumar :slightly_smiling_face:

Hi @Biswajeet_kumar

Use the Marketplaces package as Email Activitie for Local Emails (.eml/.msg)

After installing you can use Read EML activity or Read MSG activity, and it will directly give you Subject, Body and Attachments from the outlook saved emails

Cheers

You can try the below :

Mail Message Converter - RPA Component | UiPath Marketplace | Overview

ADROSONIC - Email File Reader - RPA Component | UiPath Marketplace | Overview

ADROSONIC - Email Converter - RPA Component | UiPath Marketplace | Overview

@Biswajeet_kumar USer for ach file in folder activity and indicate the folder where you have save the mail messages later on use the currentfile.fullname and use invoke code activity and use following invoke code

Try
Dim outlookApp As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application()
Dim msg As Microsoft.Office.Interop.Outlook.MailItem = CType(outlookApp.Session.OpenSharedItem(filePath), Microsoft.Office.Interop.Outlook.MailItem)

EmailSubject = msg.Subject
EmailBody = msg.Body
EmailBodyAsHTML = msg.HTMLBody
EmailDateTime = msg.ReceivedTime.ToString

Catch ex As System.Exception
Dim ErrorMessage = ex.Message
End Try


and refer these image for arguments

1 Like