How can I retrieve and download email attachments from previous days in a specific email account?


Hi team, I receive emails every day, and my requirement is to download the attachments from the emails I received on the previous day. How can I achieve this? Can anyone suggest an idea or solution?

@Kumar_Sahu_Sameer

please use get outlook mail messages activity with filter

"[Received] >= '" + DateTime.Today.AddDays(-1).ToString("d") + " 00:00AM' AND [Received] < '"+ DateTime.Today.ToString("d") + " 00:00AM'"

https://docs.uipath.com/activities/other/latest/productivity/get-outlook-mail-messages#filtering-examples

Hope this helps

cheers

@Anil_G

It’s not working.

@Kumar_Sahu_Sameer

Please check if your target outlook folder is having any mails that have arrived yesterday

Tried the same formula and it worked…all the subjects are printed

cheers

Highlighted in the Green colour what value should I fill

Hi,

You have to choose NewestFirst here, the top property is used to get how many emails you need from the inbox. For eg:- If you need top 5 emails from the inbox , you will set as 5.

@Kumar_Sahu_Sameer

please fill number is top…that should solve…include may be 100 which si max

if you need only one message use 1

and orderby is to order your retreived mails you want the newest or the oldest

cheers

Thank you all for your help! Everything went smoothly and I am grateful for your input and feedback.

1 Like

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