How to send a Monthly Report Email in outlook

Hi,

Bot will process the files every day and will send Emails with Excel attachments,
but what i need is, on the last day of the Month, bot needs to download all the attachments that have been sent in that month and merge them and make a new excel file with all those files data together and should trigger an email.

How can we achieve this?

TIA

@Santhosh_Hyd

Are you deleting daily sent reports ?

yes. but those reports will be in the Outlook

@Santhosh_Hyd

Ok. You can download all reports based on subject and then merge all reports to send final report through the mail.

Instead of that if you save reports in one folder and then you can easily merge all reports and send na. No need to download attachments from mail. It’s my opinion.

1 Like

Using Get Outlook mail message read mails from sent items := Apply Filter for Date
Then Download attachments by using

> "Save Attachment"

in specific folder then Using for each for that directory i.e. **

Directory.GetFiles(Attachments Path)

**
And one by one read those files nd append then one by one

1 Like

problem is those all attachments will have same name, so when i download from the outlook in UiPath, only one file will get saving as they all have same name, its replacing the file whenever it downloads the attachment

can you tell me the code for Filter for data?

@Santhosh_Hyd

I hope you are using Save Attachment activity to download attachments from mail. Create one integer variable and assign with 1 initially. Add this value at the end of file name.

          filename+"_"+count.Tostring
1 Like

In For Each
Item.Headers(“Date”)>= FromDate and tem.Headers(“Date”)<=ToDate

1 Like