How to write the every email info (like Email ID, Subject and received time) to an excel file

Hi,

I have read the Email using IMAP and downloaded the attachments to a folder. Now I need to store every unread mail data’s to an Excel file.
The Excel file should be created automatically every day depending on the date and also wanted to write the email info like Email ID, Received time and Subject to each separate column in the Excel file. For every new email, the data’s should be entered into a new row. If I’m getting 50 emails today, all the 50 emails info should be saved in the excel.

Please help me in this. Thanks in advance.

Hi @Kailash_Kumar

You need to do follwing

1 Build a datatable with columns you want
2 have a for each loop for email collection
3 assign mail.sender.address to emailid
4 mail.headers(“date”). tostring to date received
5 mail.subject to silubject variable
6 use add data row for adding above variables
7 use write range to save it to excel

Thanks
Prankur

2 Likes

In read mailmessage don’t add any filters while Looping have condition like mail.headers(“date”)=today to filter the all mail of that day.

Thanks. Its Working.
Another doubt my robot is running continuously for every 10 min. So after 10 min its going and checking the mail again, at that time the data’s are overwritten. If 4 data’s are saved in first checking, I need to put next checking data’s from 5. I used append activity but it didn’t work properly. Append will work in excel scope activity.
Please help me in this.

Dont use write range, use Append Range instead

can u send the flow so that i can check with mine

My workflow is working but I have one doubt, my robot is running continuously for every 10 min. So after 10 min it’s going and checking the mail again, at that time the data’s are overwritten. If 4 data’s are saved in first checking, I need to put next checking data’s from 5. I used append activity but it didn’t work properly. Append will work in excel scope activity.
Please help me with this.Email Extract to Excel.xaml (31.3 KB)