Save outlook emails

how to save all emails as .msg file and them them as proces with the help of their file names or open the mail to perform any uipath activity?

what i want to do here is

get outlook mails
save emails
open emails through their paths by start application or start process
then here starts the ui activity
get the html code
get the date from html code
close application
iterate through all the emails of mailmessages(output of get outlook message)

image
Hope it helps

Save Mail Message: Access to the path ‘C:\Saved Emails’ is denied.

Hi @Sakshi_Jain

This happens because of wrong input for file path.

After getting outlook mail message, the result is a list of mail message (Let’s say declare it as mailList).

You can use For each item in the mailList:

Save Mail Message in the loop,
the folder path should be something like

"C:\Saved Emails\ " + item.Subject.ToString + “.msg” (please remove the space after Saved Emails, somehow it won’t appear as \ if I dont have a space after it)

which will save one or multiple mails.

Note that if it is a forwarded mail which may appear as “FW: xxx” in the subject. In this case, item.Subject.ToString should be replaced by item.Subject.Replace(“:”,“”).ToString since “:” is not supported in name format.

Regards,
Kah Liang