My rpa Inbox in almost full with 70000 mails I need to delete the mails which are 3 months and older from it. How do I achieve this ?
Hello @Ishan_Shelke ,
You could try this sequence of activities:
More info about activities you can find here:
-
Get Outlook Mail Messages https://docs.uipath.com/activities/docs/get-outlook-mail-messages
-
Delete Outlook Mail Message https://docs.uipath.com/activities/docs/delete-outlook-mail-message
-
Retry Scope https://docs.uipath.com/activities/docs/retry-scope
Hope it helps!
Best regards,
Marius
Hi @Ishan_Shelke,
-
Assign activity: currentDate = Now
-
Assign activity: cutoffDate = currentDate.AddMonths(-3)
-
For Each activity:
TypeArgument: System.Net.Mail.MailMessage
Values: List of emails in inboxBody of For Each:
Assign activity:
emailDateString = item.Headers(“Date”)Assign activity:
emailDate = DateTime.ParseExact(emailDateString, “ddd, dd MMM yyyy HH:mm:ss zzz”, CultureInfo.InvariantCulture)If activity:
DateTime.Compare(emailDate, cutoffDate) < 0
Then activity:
item.Delete()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.